10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am trying to use awk to format the file below, which is tab-delimited. The desired out is space delimited and is in the order of
$9 $13 $2 $10-$11.$10 and $11 are often times multiple values separated by a comma, so the value in $10 is combined with the first value from
$11 using the comma.... (5 Replies)
Discussion started by: cmccabe
5 Replies
2. Shell Programming and Scripting
I have a CSV file like this:
abc ,def ghi ,jkl
mno ,pqr stu ,vwx
Desired Output:
Field 1:
abc
mno
Field 2:
def ghi
pqr stu
Field 3:
jkl
vwx
This does not work:
for i in `cat file.txt`
do
Field1=`echo $i | awk -F ',' '{print $1}'| sed 's/^ *// ; s/ *$//'`... (8 Replies)
Discussion started by: shellguy
8 Replies
3. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
The assignment is to convert a text table to csv format. I've got the cleaning up done, but I need to swap two... (0 Replies)
Discussion started by: VoiceInADesert
0 Replies
4. Shell Programming and Scripting
Hi Everyone,
# cat 1.txt
1321631,77770132976455,19,20091001011859,20091001011907
1321631,77770132976455,19,20091001011859,20091001011907
1321631,77770132976455,19,20091001011859,20091001011907
# cat 1.txt | awk -F, '{OFS=",";print $1,$3,$4,$5}'
1321631,19,20091001011859,20091001011907... (7 Replies)
Discussion started by: jimmy_y
7 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I am working right now with a csv file and I want to insert an excel formula say to the 6th column.
sample csv file:
1234,lag,0,77,544,,7
1234,lag,222,0,7,,7
at first i used a simple command:
sed 's/^\(.\{17\}\)/\1word/' file.csv
but the result is this:
... (2 Replies)
Discussion started by: paoie
2 Replies
6. UNIX for Dummies Questions & Answers
hi forums
i need help with a little problem i am having.
i need to count the number of fields that are in a saved variable so i can use that number to make a different function work properly.
is there a way of doing this without using SED/AWK?
anything would be greatly appreciated (4 Replies)
Discussion started by: strasner
4 Replies
7. UNIX for Advanced & Expert Users
The following output has a space as the Field Separator.
I need:
$1 Set the field width to 15 then zero-fill to the right.
$6 Set the field width to 15 then zero-fill to the left.
01-10016 1000 MV010 20090708 12003 $NK0015101 01
01-100161 12000 MV070 20090708 12003 $NK0015201 01... (6 Replies)
Discussion started by: talk2pawee
6 Replies
8. Shell Programming and Scripting
Hi,
I have two issues:
I have one file say file1.dat and its over 3GB. It contains pipe delimited fields. The first line in the file is the header field which tells the column names etc. and from second line it's the data fileds with pipe delimited. Something like below:
... (5 Replies)
Discussion started by: rkumar28
5 Replies
9. Shell Programming and Scripting
I'm working on formatting some attendance data to meet a vendors requirements to upload to their system. With some help on the forums here, I have the data close. But they've since changed what they want.
The vendor wants me to submit three fields to them. Field 1 is the studentid field,... (4 Replies)
Discussion started by: axo959
4 Replies
10. Shell Programming and Scripting
Hi, I'm a newbie to sed and I'm having trouble working with sed and fields.
Suppose I have a text file with:
AAA RFG:$2.10:6:25Oct06
WDD GGTR:$3.50:5:25Oct06
ADDSJ OO:$1.37:3:26Oct07
UGBDN S:$4.73:1:27Oct06
USY ADC:$2.38:20:27Oct06
And I want to substitute field 2 of line 3 with, say,... (3 Replies)
Discussion started by: aloe_vera
3 Replies