10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
i have file as with the below content
aaa.bbb.cc.dd
aaa.fff.bb
yyyyy.rrrrr.ggggg.iii
wwww.w.r.ty
i want the o/p as below
dd
bb
iii
ty
but i dont want to use awk. is there any other way to do this ? (5 Replies)
Discussion started by: anandgodse
5 Replies
2. Shell Programming and Scripting
I have a file which contains 3 fields separated by tabs example
andrew kid baker
I need to swap kid and baker using cut and paste commands how is this to be done?
Thanks (3 Replies)
Discussion started by: drew211
3 Replies
3. UNIX for Advanced & Expert Users
Hi,
I've got a query regarding which of the following is more efficient & why -
cat <filename>|cut -d'*' -f2- > <newfilename>
or
cut -d'*' -f2- <filename> > <newfilename>
Thanks. (17 Replies)
Discussion started by: sumoka
17 Replies
4. Shell Programming and Scripting
I have a file and need to only select users that have a shell of “/bin/bash” in the line using awk or sed please help (4 Replies)
Discussion started by: boyboy1212
4 Replies
5. 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
6. Shell Programming and Scripting
Hi,
Need a help with shell script. I have to search for a string in one of the file, if match found, copy the line to a new file and delete the line from the exisiting file.
eg:
83510000000000063800000.1800000.1600000.1600000.2400000.1800000.2000000.21... (6 Replies)
Discussion started by: gpaulose
6 Replies
7. UNIX for Advanced & Expert Users
Hello,
I had posted earlier about printing fields using AWK, but now I have a slightly different problem. I have text files in the format:
1*2,3,4,5
and wish to print the first, third, and fifth fields, including the asterisk and commas. In other words, after filtering it should look... (1 Reply)
Discussion started by: Jahn
1 Replies
8. Shell Programming and Scripting
hi,
I have a file with content like this for an employee:
EmployeeID
101
Day_type, day
vacation,1/2/2009
sick day, 3/2/2009
personal day, 4/5/2009
jury duty day, 5/5/2009
how do I make the result to show:
EmployeeID,Day_type,day
101,vacation,1/2/2009
101,sick day,... (6 Replies)
Discussion started by: jbchen
6 Replies
9. Shell Programming and Scripting
Hi i need a favour
i have a file which has some trillions of records. The file is like this
11111000000000192831840914000000000000000000000000000
45789899090000000000000000011111111111111111111111111
I want to cut specific postions in each line like cut1-3 and assisgn it to a variable and... (5 Replies)
Discussion started by: richa2.m
5 Replies
10. UNIX for Dummies Questions & Answers
Hi,
Let's say that I have a file called table, I know that if I need to see a the second column for exampls I use:
awk ' {print $2}' table.txt
Is there anyway to use awk to actually cut a column and put it somewhere else in the table?:confused: (8 Replies)
Discussion started by: cosmologist
8 Replies