Sponsored Content
Top Forums Shell Programming and Scripting Need shell script to append double quotes for each column in a file Post 303003970 by RudiC on Sunday 24th of September 2017 06:42:10 AM
Old 09-24-2017
That's not a back reference, but one on the s command's flags following the replacement. info sed:

Quote:
FLAGS:

'g'__________Apply the replacement to _all_ matches to the REGEXP, not just the first.

'NUMBER' __Only replace the NUMBERth match of the REGEXP.

Last edited by RudiC; 09-24-2017 at 07:48 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

put double quotes for a column

Hi, I have a file which looks like this, I have stripped most of the columns: 2006,UCA,"02452","NM","1","M","84",123,aa 2006,UCA,"02452","NM","1","L","84",123,bb 2006,UCA,"02452","NM","1","L","84",432,cc 2006,UCA,"02452","NM","1","L","33",213,dd 2006,UCA,"02452","NM","1","L","33",124,ee... (3 Replies)
Discussion started by: sumeet
3 Replies

2. Shell Programming and Scripting

To append two columns without double quotes

Hi i have a file with follw data "20090427","0","","16371311","-100200","","","","16371311","JUL","09" In the 10th column i need to convert the month name into month number in this case JUL will be 7 and append the 10th and 11th column which shows me the output as 709. Can you suggest a shell... (11 Replies)
Discussion started by: vee789
11 Replies

3. Shell Programming and Scripting

shell script - to append single quotes and comma

file1 ---- 34556745 32678343 31576776 31455566 21356666 I want to assign the record values to a variable in the below format, so that I can use output in .sql file for querying in database. ('34556745', '32678343', '31576776', '31455566', '21356666') ----------- below is the... (11 Replies)
Discussion started by: rajivrsk
11 Replies

4. UNIX for Dummies Questions & Answers

append column and row header to a file in awk script.

Hi! Is there a way to append column and row header to a file in awk script. For example if I have Jane F 39 manager Carlos M 40 system administrator Sam F 20 programmer and I want it to be # name gend age occup 1 Jane F 39 manager 2 Carlos M ... (4 Replies)
Discussion started by: FUTURE_EINSTEIN
4 Replies

5. Shell Programming and Scripting

Issue with Single Quotes and Double Quotes for prompt PS1

Hi, Trying to change the prompt. I have the following code. export PS1=' <${USER}@`hostname -s`>$ ' The hostname is not displayed <abc@`hostname -s`>$ uname -a AIX xyz 1 6 00F736154C00 <adcwl4h@`hostname -s`>$ If I use double quotes, then the hostname is printed properly but... (3 Replies)
Discussion started by: bobbygsk
3 Replies

6. Shell Programming and Scripting

Shell script that should remove unnecessary commas between double quotes in CSV file

i have data as below 123,"paul phiri",paul@yahoo.com,"po.box 23, BT","Eco Bank,Blantyre,Malawi" i need an output to be 123,"paul phiri",paul@yahoo.com,"po.box 23 BT","Eco Bank Blantyre Malawi" (5 Replies)
Discussion started by: mathias23
5 Replies

7. Shell Programming and Scripting

Handling embedded double quotes within column data

I have a text file where each field is enclosed in double quotes and separated by a comma. But in certain rows we have embedded double quotes within column data For e.g """TRUSPICE CENTRE"" CLAYTON AU" The above value is for a single column but there are embedded quotes within... (2 Replies)
Discussion started by: abhilashnair
2 Replies

8. Shell Programming and Scripting

Replace Double quotes within double quotes in a column with space while loading a CSV file

Hi All, I'm unable to load the data using sql loader where there are double quotes within the double quotes As these are optionally enclosed by double quotes. Sample Data : "221100",138.00,"D","0019/1477","44012075","49938","49938/15043000","Television - 22" Refurbished - Airwave","Supply... (6 Replies)
Discussion started by: mlavanya
6 Replies

9. Shell Programming and Scripting

awk script to append suffix to column when column has duplicated values

Please help me to get required output for both scenario 1 and scenario 2 and need separate code for both scenario 1 and scenario 2 Scenario 1 i need to do below changes only when column1 is CR and column3 has duplicates rows/values. This inputfile can contain 100 of this duplicated rows of... (1 Reply)
Discussion started by: as7951
1 Replies

10. UNIX for Beginners Questions & Answers

How to insert data into black column( Secound Column ) in excel (.XLSX) file using shell script?

Source Code of the original script is down below please run the script and try to solve this problem this is my data and I want it column wise 2019-03-20 13:00:00:000 2019-03-20 15:00:00:000 1 Operating System LAB 0 1 1 1 1 1 1 1 1 1 0 1 (5 Replies)
Discussion started by: Shubham1182
5 Replies
M4(1)								   User Commands							     M4(1)

NAME
m4 - macro processor SYNOPSIS
m4 [OPTION]... [FILE]... DESCRIPTION
Process macros in FILEs. If no FILE or if FILE is `-', standard input is read. Mandatory or optional arguments to long options are mandatory or optional for short options too. Operation modes: --help display this help and exit --version output version information and exit -E, --fatal-warnings once: warnings become errors, twice: stop execution at first error -i, --interactive unbuffer output, ignore interrupts -P, --prefix-builtins force a `m4_' prefix to all builtins -Q, --quiet, --silent suppress some warnings for builtins --warn-macro-sequence[=REGEXP] warn if macro definition matches REGEXP, default $({[^}]*}|[0-9][0-9]+) -W, --word-regexp=REGEXP use REGEXP for macro name syntax Preprocessor features: -D, --define=NAME[=VALUE] define NAME as having VALUE, or empty -I, --include=DIRECTORY append DIRECTORY to include path -s, --synclines generate `#line NUM "FILE"' lines -U, --undefine=NAME undefine NAME Limits control: -g, --gnu override -G to re-enable GNU extensions -G, --traditional suppress all GNU extensions -H, --hashsize=PRIME set symbol lookup hash table size [509] -L, --nesting-limit=NUMBER change nesting limit, 0 for unlimited [0] Frozen state files: -F, --freeze-state=FILE produce a frozen state on FILE at end -R, --reload-state=FILE reload a frozen state from FILE at start Debugging: -d, --debug[=FLAGS] set debug level (no FLAGS implies `aeq') --debugfile[=FILE] redirect debug and trace output to FILE (default stderr, discard if empty string) -l, --arglength=NUM restrict macro tracing size -t, --trace=NAME trace NAME when it is defined FLAGS is any of: a show actual arguments c show before collect, after collect and after call e show expansion f say current input file name i show changes in input files l say current input line number p show results of path searches q quote values as necessary, with a or e flag t trace for all macro calls, not only traceon'ed x add a unique macro call id, useful with c flag V shorthand for all of the above flags If defined, the environment variable `M4PATH' is a colon-separated list of directories included after any specified by `-I'. Exit status is 0 for success, 1 for failure, 63 for frozen file version mismatch, or whatever value was passed to the m4exit macro. AUTHOR
Written by Rene' Seindal. REPORTING BUGS
Report bugs to: bug-m4@gnu.org GNU M4 home page: <http://www.gnu.org/software/m4/> General help using GNU software: <http://www.gnu.org/gethelp/> COPYRIGHT
Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO
The full documentation for m4 is maintained as a Texinfo manual. If the info and m4 programs are properly installed at your site, the com- mand info m4 should give you access to the complete manual. GNU M4 1.4.18 December 2016 M4(1)
All times are GMT -4. The time now is 09:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy