10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
We have a csv file as mentioned below and the requirement is to change the date format in file as mentioned below.
Current file (file.csv)
----------------------
empname,date_of_join,dept,date_of_resignation
ram,08/09/2015,sales,21/06/2016
"akash,sahu",08/10/2015,IT,21/07/2016
... (6 Replies)
Discussion started by: gopal.biswal
6 Replies
2. Shell Programming and Scripting
Hello Team,
Could you please help me with the below question?
I have a file with the following properties
1) File Delimiter is ;
2) Text columns are within double quotes
3) Numeric columns will not have double quotes
4) File has total 6 columns
Please see a sample record from file
... (3 Replies)
Discussion started by: sam99
3 Replies
3. Shell Programming and Scripting
Hi All,
I have my data like below
"1","abc,db","hac,aron","4","5"
Now I need to extract 1,2,4th columns
Output should be like
"1",abc,db","4"
Am trying to use cut command but not able to get the results.
Thanks in advance. (4 Replies)
Discussion started by: weknowd
4 Replies
4. Shell Programming and Scripting
Hi All,
I'm stuck-up in finding a way to skip the delimiter which come within double quotes using awk or any other better option. can someone please help me out.
Below are the details:
Delimited: |
Sample data: 742433154|"SYN|THESIS MED CHEM PTY.... (2 Replies)
Discussion started by: BrahmaNaiduA
2 Replies
5. Shell Programming and Scripting
Hi,
So I was trying this awk snippet
awk -F, '$1 ~ /Match/' File
This is my sample file output
Name,Age,Nationality,Description
Jack,20,American,Tall, caucasian, lean
Mary,30,British,Short,white,slim
I would expect expected Output to be, when a certain match is met say $1 is... (2 Replies)
Discussion started by: sidnow
2 Replies
6. Shell Programming and Scripting
I am trying to re-format a .csv file using awk. I have 6 fields in the .csv file. Some of the fields are enclosed in double quotes and contain comma's inside the quotes. awk is breaking this into multiple fields.
Sample lines from the .csv file:
Device Name,Personnel,Date,Solution... (1 Reply)
Discussion started by: jxrst
1 Replies
7. Shell Programming and Scripting
Hi,
I have file1 where I have my ids and file2 where I have ids and corresponding texts. I have to match the ids of my file1 to file2 and write in ids and corresponding text to another file.
e.g
file1
----
23
1
4
file2
----
23,"test, test2"
1,new
awk -F, 'BEGIN{FS=","}NR==FNR{ a;next}... (1 Reply)
Discussion started by: babom
1 Replies
8. Shell Programming and Scripting
Hi Experts,
How to ignore any delimiters which is inside the quotes. in awk script.
I am having script which counts number of delimiters from the line now i need count delimiters only separators .
`grep "14" | cut -d"=" -f2` -F'~'if (NF-1 != v1) '
this command counts number of Tilde... (7 Replies)
Discussion started by: Ganesh Khandare
7 Replies
9. UNIX for Dummies Questions & Answers
Hi ,
I have extract a single field from the 2nd row of a file of which the format is as given below
"Field1","Field2","Field3",...,"Field17",...
I need to cut Field17 as such (no quotes required)..
I give the command
head -2 file_name | tail -1 | cut -d "," -f17
But the output is... (2 Replies)
Discussion started by: nivin_govindan
2 Replies
10. Shell Programming and Scripting
Hi,
I'm trying to insert double quotes right after the third delimiter in a file. Delimiter is ^Z.
For example:
Input:
Oct ^Z 1234 ^Z John ^Z Hello!"
Desired Output:
Oct ^Z 1234 ^Z John ^Z "Hello!"
Any ideas? (1 Reply)
Discussion started by: kangaroo
1 Replies