由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - read file help!
相关主题
a question about regular expression请问如果用SAS 解决这个问题
which shell is the best among csh, ksh, bsh?弱问一个SAS里面求adjusted means的问题
bourne shell program Question在SAS里如何用array或者macro改进这段程序?求指教!
a puzzlehelp about initial value in retain statement
bash programming problem on string请教proc sql处理missing value的问题
A join B, spark里面怎么写?包子问题请教( sas)
请问SAS中如何通过组内一个变量的值控制整组变量help!! help!! SAS help!! Urgent!!
How to change sas dataset column orderSAS BASE 官方sample 第三题 求解析 谢谢!
相关话题的讨论汇总
话题: var2话题: var4话题: var3话题: read话题: file
进入Unix版参与讨论
1 (共1页)
e****e
发帖数: 179
1
I have a data file like this:
A B C D
1 2 3 4
2 3 3 34
* * * *
I want to read these number and assign them to some variables, something like:
1st time:
var1=1, var2=2 var3=3, var4=4
then do something with these Var*
then 2nd time
var2=2, var2=3, var3=3 var4=34
then do something....
and so on.
How to do it in C shell script?
Thanks.
cat
c**t
发帖数: 2744
2
why not use perl?

【在 e****e 的大作中提到】
: I have a data file like this:
: A B C D
: 1 2 3 4
: 2 3 3 34
: * * * *
: I want to read these number and assign them to some variables, something like:
: 1st time:
: var1=1, var2=2 var3=3, var4=4
: then do something with these Var*
: then 2nd time

a**n
发帖数: 313
3
In Bourne shell..
#############################
#if you file is like "a b c d"
#!/bin/sh
while read var1 var2 var3 var4
do
: #the command you want
done < filename
##############################

【在 e****e 的大作中提到】
: I have a data file like this:
: A B C D
: 1 2 3 4
: 2 3 3 34
: * * * *
: I want to read these number and assign them to some variables, something like:
: 1st time:
: var1=1, var2=2 var3=3, var4=4
: then do something with these Var*
: then 2nd time

1 (共1页)
进入Unix版参与讨论
相关主题
SAS BASE 官方sample 第三题 求解析 谢谢!bash programming problem on string
包子呼唤大牛--问关于C++Destructor的问题 (转载)A join B, spark里面怎么写?
Re: 浏览mitbbs的时候被随机重定向到别的网站了 (转载)请问SAS中如何通过组内一个变量的值控制整组变量
shell script和variable indexHow to change sas dataset column order
a question about regular expression请问如果用SAS 解决这个问题
which shell is the best among csh, ksh, bsh?弱问一个SAS里面求adjusted means的问题
bourne shell program Question在SAS里如何用array或者macro改进这段程序?求指教!
a puzzlehelp about initial value in retain statement
相关话题的讨论汇总
话题: var2话题: var4话题: var3话题: read话题: file