Sponsored Content
Top Forums Shell Programming and Scripting Help with column delete from multiple files Post 303000721 by paul1234 on Tuesday 18th of July 2017 01:59:52 PM
Old 07-18-2017
Help with column delete from multiple files

sample .csv files with 7 columns.I want to delete the last column from each of the below files but retain their file names (1_ContractDocuments.csv,2_ContractDocuments.csv etc.)
There can be more files like 3_ContractDocuments.csv , 4_ContractDocuments.csv . Can you please help

source .csv files :

file 1 : 1_ContractDocuments.csv
Code:
CW2218471,testfile2.pdf,CW2218471/WS1033214854/Doc1043743258.pdf,Final Contract Document(s),,Published,1
CRW2218451,testfile1.pdf,CW2218471/CRW2218451/Doc1031919943.pdf,Main,,Published,1
CRW2218451,testfile3.pdf,CW2218471/CRW2218451/Doc1031919945.pdf,Main,,Published,1
CRW2218451,testfile4.pdf,CW2218471/CRW2218451/WS1031919946/Doc1031919947.pdf,Main,,Published,1

file 2 : 2_ContractDocuments.csv
Code:
CW22,testfile2.pdf,CW22/WS1033214854/Doc1043743258.pdf,Final Contract Document(s),,Published,1
CRW22,testfile1.pdf,CW22/CRW2218451/Doc1031919943.pdf,Main,,Published,1
CRW22,testfile3.pdf,CW22/CRW2218451/Doc1031919945.pdf,Main,,Published,1
CRW22,testfile4.pdf,CW22/CRW2218451/WS1031919946/Doc1031919947.pdf,Main,,Published,1


output expected :

file 1 : 1_ContractDocuments.csv (name of file same as before with last column deleted)
Code:
CW2218471,testfile2.pdf,CW2218471/WS1033214854/Doc1043743258.pdf,Final Contract Document(s),,Published
CRW2218451,testfile1.pdf,CW2218471/CRW2218451/Doc1031919943.pdf,Main,,Published
CRW2218451,testfile3.pdf,CW2218471/CRW2218451/Doc1031919945.pdf,Main,,Published
CRW2218451,testfile4.pdf,CW2218471/CRW2218451/WS1031919946/Doc1031919947.pdf,Main,,Published

file 2 : 2_ContractDocuments.csv (name of file same as before with last column deleted)
Code:
CW22,testfile2.pdf,CW22/WS1033214854/Doc1043743258.pdf,Final Contract Document(s),,Published
CRW22,testfile1.pdf,CW22/CRW2218451/Doc1031919943.pdf,Main,,Published
CRW22,testfile3.pdf,CW22/CRW2218451/Doc1031919945.pdf,Main,,Published
CRW22,testfile4.pdf,CW22/CRW2218451/WS1031919946/Doc1031919947.pdf,Main,,Published


Last edited by RudiC; 07-18-2017 at 03:07 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

when I try to run rm on multiple files I have problem to delete files with space

Hello when I try to run rm on multiple files I have problem to delete files with space. I have this command : find . -name "*.cmd" | xargs \rm -f it doing the work fine but when it comes across files with spaces like : "my foo file.cmd" it refuse to delete it why? (1 Reply)
Discussion started by: umen
1 Replies

2. UNIX for Dummies Questions & Answers

Need a script to delete multiple files

Hello, I am working with about 500,000 text files and 90% of them are duplicates. I need a way to delete the duplicate ones. The files are email messages with the following file name examples: 20040129-1457 This is the Subject line.txt 20040129-1457 This is the Subject line-1.txt... (3 Replies)
Discussion started by: navycow
3 Replies

3. Shell Programming and Scripting

Script to delete all data from multiple files

its urgent!!!!!!111 i need a script which can delete data from multiple files. plz if anybody knows the script plz write a mail to me : (Email addresses are not allowed) (5 Replies)
Discussion started by: uni_ajay_r
5 Replies

4. Shell Programming and Scripting

combine multiple files by column into one files already sorted!

I have multiple files; each file contains a certain data in a column view simply i want to combine all those files into one file in columns example file1: a b c d file 2: 1 2 3 4 file 3: G (4 Replies)
Discussion started by: ahmedamro
4 Replies

5. Shell Programming and Scripting

script to delete multiple files in remote machine

Requirement Several files in remote machines ought to be deleted via sh. Name of the files to be deleted are know Approach 1) script was written with ftp (requires credential) and delete command. File names were passed as array(iterated via for loop-with ftp+delete commands enclosed within... (1 Reply)
Discussion started by: vkalya
1 Replies

6. Shell Programming and Scripting

Column extraction from multiple files to multiple files

I have roughly ~30 .txt files in a directory which all have unique names. These files all contain text arranged in columns separated by whitespace (example file: [#YY MM DD hh mm WDIR WSPD GST WVHT DPD APD MWD PRES ATMP WTMP DEWP VIS TIDE #yr mo dy hr mn degT m/s m/s m sec ... (5 Replies)
Discussion started by: aozgaa
5 Replies

7. UNIX for Dummies Questions & Answers

How To Delete Multiple Files At Once?

I Want to delete the following files together,what command should i pass for that? (Note:- All Start With .) .bash_logout .bashrc .bash_profile .rtorrent.rc ... (3 Replies)
Discussion started by: anime12345
3 Replies

8. Shell Programming and Scripting

Select multiple column from multiple files

Hi Friends, $ cat test1.txt emeka:1438 shelley:1439 dmeyer:1440 kurtarn:1441 abdul:1442 $ cat test2.txt 1:a 2:b 3:c 4:d $ cat test3.txt cat:dog:bat man:hot:cold (5 Replies)
Discussion started by: Jewel
5 Replies

9. UNIX for Dummies Questions & Answers

Stack data from multiple files into one, with variable column files

Hello Gurus, Im new to scripting. Got struck with a file merge issue in Unix. Was looking for some direction and stumbled upon this site. I saw many great posts and replies but couldnt find a solution to my issue. Greatly appreciate any help.. I have three csv files -> Apex_10_Latest.csv,... (1 Reply)
Discussion started by: wamshi
1 Replies

10. UNIX for Beginners Questions & Answers

How to copy a column of multiple files and paste into new excel file (next to column)?

I have data of an excel files as given below, file1 org1_1 1 1 2.5 100 org1_2 1 2 5.5 98 org1_3 1 3 7.2 88 file2 org2_1 1 1 2.5 100 org2_2 1 2 5.5 56 org2_3 1 3 7.2 70 I have multiple excel files as above shown. I have to copy column 1, column 4 and paste into a new excel file as... (26 Replies)
Discussion started by: dineshkumarsrk
26 Replies
PS2PDF(1)							    Ghostscript 							 PS2PDF(1)

NAME
ps2pdf - Convert PostScript to PDF using ghostscript ps2pdf12 - Convert PostScript to PDF 1.2 (Acrobat 3-and-later compatible) using ghostscript ps2pdf13 - Convert PostScript to PDF 1.3 (Acrobat 4-and-later compatible) using ghostscript ps2pdf14 - Convert PostScript to PDF 1.4 (Acrobat 5-and-later compatible) using ghostscript SYNOPSIS
ps2pdf [options...] {input.[e]ps|-} [output.pdf|-] ps2pdf12 [options...] {input.[e]ps|-} [output.pdf|-] ps2pdf13 [options...] {input.[e]ps|-} [output.pdf|-] ps2pdf14 [options...] {input.[e]ps|-} [output.pdf|-] DESCRIPTION
The ps2pdf scripts are work-alikes for nearly all the functionality (but not the user interface) of Adobe's Acrobat(TM) Distiller(TM) prod- uct: they convert PostScript files to Portable Document Format (PDF) files. If the output filename is not specified, the output is placed in a file of the same name with a '.pdf' extension in the current working directory. Either the input filename or the output filename can be '-' to request reading from stdin or writing to stdout, respectively, when used as a filter. The three scripts differ as follows: - ps2pdf12 will always produce PDF 1.2 output (Acrobat 3-and-later compatible). - ps2pdf13 will always produce PDF 1.3 output (Acrobat 4-and-later compatible). - ps2pdf14 will always produce PDF 1.4 output (Acrobat 5-and-later compatible). - ps2pdf per se currently produces PDF 1.4 output. However, this may change in the future. If you care about the compatibility level of the output, use ps2pdf12, ps2pdf13 or ps2pdf14, or use the -dCompatibility=1.x switch in the command line. There are some limitations in ps2pdf's conversion. See the HTML documentation for more information. A large number of Adobe Distiller(TM) parameters which can be used to control the conversion are also documented there, including instructions for generating PDF/X and PDF/A documents. OPTIONS
The ps2pdf scripts use the same options as gs(1). EXAMPLES
Converting a figure.ps to figure.pdf: ps2pdf figure.ps A conversion with more specifics: ps2pdf -dPDFSETTINGS=/prepress figure.ps proof.pdf Converting as part of a pipe: make_report.pl -t ps | ps2pdf -dCompatibility=1.3 - - | lpr SEE ALSO
gs(1), ps2pdfwr(1), Ps2pdf.htm in the Ghostscript documentation BUGS
See http://bugs.ghostscript.com/ and the Usenet news group comp.lang.postscript. VERSION
This document was last revised for Ghostscript version 9.07. AUTHOR
Artifex Software, Inc. are the primary maintainers of Ghostscript. This manpage by George Ferguson. 9.07 12 February 2013 PS2PDF(1)
All times are GMT -4. The time now is 09:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy