The 1st CSV file contains 3 columns ( Client Name, Domain and Server Name ).
It will have more than 2000+ entries.
The 2nd CSV file contains 2 columns ( Server Name, Value ).
This will have just 30 to 40 entries for all serves and value belongs to each server. The common value on both the CSV file is the server name.
I want to append the value from 2nd CSV file to the 1st one based on the sever name. As I have little knowledge on awk / sed , I do not know if that can be achieved.
Just want to check here how would I able to do this ?
Thanks and let me know if I need to give an other specifics.
I just tried your command , but it did not give me any results and it just returned to the prompt. The field separator is "," and the OS is - SuSe Ent Linux 11.
Hi hanson44,
I think I posted the files in my original post and I am posting it again for your reference.
1st CSV File
The 1st CSV file contains 3 columns ( Client Name, Domain and Server Name ).
It will have more than 2000+ entries.
2nd CSV file
The 2nd CSV file contains 2 columns ( Server Name, Value ).
This will have just 30 to 40 entries for all serves and value belongs to each server. The common value on both the CSV file is the server name.
I want to append the value from 2nd CSV file to the 1st one based on the sever name.
Thanks very much for reposting the information. Building on what scrutinizer previously posted:
I observed a problem with blanks at the ends of some of the lines confusing things, so I used the $2=$2 and $3=$3 to clean that up to my understanding, which I confess I learned from yoda.
Thanks much for your update, still it does not work. It is not printing the 4th column , it just printing the 1st CSV file again without the additional column from file2.
---------- Post updated at 09:20 PM ---------- Previous update was at 09:16 PM ----------
You're right. Sorry about that.
It does seem to involve the blanks at the end of the line. When those are not present in the file, it works fine, even without the $2=$2 assignments (gawk / linux): ---------- Post updated at 09:27 PM ---------- Previous update was at 09:20 PM ----------
When I get rid of the blanks at the ends of the lines, it seems to work. GIve it a try:
Hi,
I have another problem. I want to sort another csv file by the first field.
result.csv
SourceFile,Airspeed,GPSLatitude,GPSLongitude,Temperature,Pressure,Altitude,Roll,Pitch,Yaw
/home/intannf/foto5/2015_0313_090651_219.JPG,0.,-7.77223,110.37310,30.75,996.46,148.75,180.94,182.00,63.92 ... (2 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...
i have a requirement to convert a xls file to csv in RHEL 6.5 and ftp it to a windows location.
i am using xls2csv utility to convert the file in linux.
Input xls file attached...
I have used below commands to convert the file to csv:
xls2csv -x test.xls -s cp1252 -d 8859-1... (3 Replies)
Hello All,
I have a .csv file named as remark.csv
The csv file content looks like below:
Remark_Hello_1 Remark_Hello_2 Remark_Hello_3 Remark_Hello_4
Hello_World_FW_0001 X
Hello_World_FW_0002 X X
Hello_World_FW_0003 X X
Hello_World_FW_0004 X X
I... (5 Replies)
Hello;
I need to generate a csv file that contains a list of all the files in a particular server (from the root directory ie: \) that have a permission stamp of 777. I would like to create the csv so that it contains the following:
server name, file name, full path name where file exists,... (17 Replies)
Request if some one could provide me shell script that converts the below "input file" to "CSV format file" given
Name Domain Contact Phone Email Location
----------------------- ------------------------------------------------ ------- ----- ---------------------------------... (7 Replies)
Hi
I have a excel file in unix machine and have to convert it into a .csv file.I have to do this from a unix script.How do we do this?
Thanks
Abhinav (3 Replies)
Since i'm new to scripting i'm findind it difficult to code a script. The script has to be an executable with 2 paramters passed to it.The Parameters are
1. The Control file name(.ctl file)
2. The Data file name(.csv file)
Does anybody have an idea about it? :confused: (3 Replies)
I am installing the my package in SCO unix 5.0 .so it will create some temporary directories and files and same will delete.So , 'rm -R ' is not working in system .in the package only it has given this command,so now without this command working we can not go forward.
so kindly help in this... (1 Reply)