|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Shell Script help for Quotation Delimited File
I need help extracting a column in a file separated by quotations. I would like to extract the first column of data and write it to a flat text file. EXAMPLE of data: Code:
"c6e181396a1100ba19c53a6757a845c4","2012-05-18","email" "70879000563753bb9051b4ab8df43ac4","2012-05-18","email" "8dc50039efcb069cc0a9c40cc9015068","2012-05-18","email" "9a0ce897cdb52a18fa5c76e3309def16","2012-05-20","email" Any help would be greatly appreciated. Nick Last edited by Scott; 05-21-2012 at 05:16 PM.. Reason: Please use code tags |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
Code:
awk -F, '{print $1}' infile > outfileCode:
cut -d , -f 1 infile > outfile |
| The Following User Says Thank You to 47shailesh For This Useful Post: | ||
hlosukwakha (05-21-2012) | ||
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
excellent! worked perfect. Another step. How may I take out the quotes?
|
|
#4
|
|||
|
|||
|
Code:
awk -F\" '{print $2}' infile > outfileOR Code:
cut -d \" -f 2 infile > outfile |
| Sponsored Links | |
|
|
#5
|
|||
|
|||
|
Try piping it through the tr command: Code:
tr -d '"' |
| Sponsored Links | |
|
|
#6
|
|||
|
|||
|
wow great! Thanks for the help. All fixed up!
![]() |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to convert a space delimited file into a pipe delimited file using shellscript? | nithins007 | Shell Programming and Scripting | 7 | 09-25-2011 05:33 AM |
| Searching a delimited Key value pairs in shell script | ANK | Shell Programming and Scripting | 4 | 09-28-2010 01:04 AM |
| convert a pipe delimited file to a':" delimited file | priyanka3006 | Shell Programming and Scripting | 6 | 05-26-2009 10:53 AM |
| Need help with shell script for chekking a column in txt file - pipe delimited | ravi0435 | UNIX for Dummies Questions & Answers | 12 | 01-02-2009 03:31 PM |
| Converting Tab delimited file to Comma delimited file in Unix | charan81 | Shell Programming and Scripting | 22 | 01-20-2006 08:24 AM |
|
|