As your requirement is still not clear to me. What I assume is you need to enter a new column to a file. If that is the requirement please try the following code.
lets say there is file named file_name which have columns as follows.
Command is:
Output should be:
So after running the command a newcol is being added. Bot sure if this may help you. Please get back to us in case you need more assistance for same.
Thanks,
R. Singh
This User Gave Thanks to RavinderSingh13 For This Post:
Thanks for allwoing me to discuss in this forum
GIVEN BELOW A simple shell script which will ask for the user to input a PC name and it will produce the output in CSV with the PC name
#! /bin/bash
read -p "enter the PC name :" pc
#checking for netstat report
netstat -pant |sed '1,2d'... (1 Reply)
Hi,
I have a requirement to append = in particular row in csv file. Data in csv is as follow:
row1,a,a,a
row2,b,b,b
row3,c,c,c
row4,d,d,d
csv should be modified at row3 and no. of columns are not fixed but rows are. output should be as:
row1,a,a,a
row2,b,b,b
row3,=c,=c,=c... (2 Replies)
My scenario is that I need to pick value from third column based on fourth column value, if fourth column value is 1 then first value of third column.Third column (2|3|4|6|1) values are cancatenated.
Main imp point, in my .csv file, third column is having price value with comma (1,20,300), it has... (2 Replies)
Hi All,
I have a CSV file in the below format:
Id,Text,File
"123","This is unix file","Unix"
"121","This is
C file","C"
Want to have output in below format:
Id,Text,File
"123","This","Unix"
"121","This","C"
File is , separator with each fields in quotes. Some fields are having... (4 Replies)
Hi, I am newbie in shell script.
I need your help to solve my problem.
Firstly, I have 2 files of csv and i want to compare of the contents then the output will be written in a new csv file.
File1:
SourceFile,DateTimeOriginal
/home/intannf/foto/IMG_0713.JPG,2015:02:17 11:14:07... (8 Replies)
Hello everyone,
I am using ksh on Solaris 10 and I'm gathering data in a CSV file that looks like this:
20170628-23:25:01,1,0,0,1,1,1,1,55,55,1
20170628-23:30:01,1,0,0,1,1,1,1,56,56,1
20170628-23:35:00,1,0,0,1,1,2,1,57,57,2
20170628-23:40:00,1,0,0,1,1,1,1,58,58,2... (6 Replies)
Hi ,
I want to add a new column 'current_time stamp' in my existing csv file with current time stamp for all the records.I tried something this but this is printing 0 with date & time and printed date one line above header.Please help
awk -F "," 'BEGIN{ OFS="," } {$6=system("date... (5 Replies)
1.csv contains following column-
Empid code loc port
101 A xy 01
102 B zx 78
103 A cg 12
104 G xy 78
2.csv contains follwing data-
Empid code loc port
101 A gf 01
102 B zx 78
103 C cg 32
104 ... (1 Reply)