Sponsored Content
Top Forums Shell Programming and Scripting help with search and replace in multiple fields Post 302435915 by Scott on Thursday 8th of July 2010 01:43:00 PM
Old 07-08-2010
Quote:
Originally Posted by dsravan
scottn,

I am getting below error with your command
Ooh! Me too Smilie

Don't know what happened there... back to the original:

Code:
$ awk -F\| -v OFS=\| 'function GSUB( F ) { gsub( ",", "", $F ) } { GSUB( 25 ); GSUB( 26 ); GSUB( 27 ) } 1' file1       
19|147444|3006266|Sponsorships 001|1869440|070210||Colorado Springs |300x100|B4098575.31|100|Scion|Da|Da|1,491|0|0.0|Clicks|2010-07-03|0|1,491|0|0|Y|1566|0|732011

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Multiple search and replace

Hi, I have different files and I want to automatically change the values of the defined variables. i want to get rid of editing all the files and make it a little bit faster. my problem is like this. 1. i will input all the new values. 2. substitute this values into the values inside the... (1 Reply)
Discussion started by: tungaw2004
1 Replies

2. UNIX for Dummies Questions & Answers

search and replace different fields

Hi i want to search and replace different field on each files. file 1 FIELD2=xxxxxxxxx FIELD4=xxxxxxxx FIELD3=xxxxxxx FIELD1=20000 file 2 FIELD1= FIELD2= file 3 FIELD2=xxxxxxxxx (3 Replies)
Discussion started by: tungaw2004
3 Replies

3. UNIX for Dummies Questions & Answers

multiple input search and replace script

hi, i want to create a script that will search and replace the values inside a particular file. i have 5 files that i need to change some values inside and i don't want to use vi to edit these files. All the inputted values on the script below will be passed into the files. cho "" echo... (3 Replies)
Discussion started by: tungaw2004
3 Replies

4. Shell Programming and Scripting

Search & replace fields from file1 to file2

hi, I have two xml files with the name source.xml and tobe_replaced.xml. Sample data: source.xml contains: <?xml version="1.0"?> <product description="prod1" product_info="some/info"> <product description="prod2" product_info="xyz/allinfo"> <product description="abc/partialinfo"... (2 Replies)
Discussion started by: dragon.1431
2 Replies

5. Shell Programming and Scripting

Find and Replace in multiple fields using awk

Hi, Say I have a record "1|22| | |". In which the third and fourth fields are <space> alone. I have to replace the <Space> with <null>. Input: "1|22| | |" --> "1|22|<space> |<space> |" Expected output: "1|22|||" --> "1|22|<null> |<null>|" I tried: echo "1|22| | |" | awk -F... (4 Replies)
Discussion started by: machomaddy
4 Replies

6. Shell Programming and Scripting

perl: search replace in multiple files

When I use special characters the command to replace multiple files with a string pattern does nt work. ---------- Post updated at 12:33 PM ---------- Previous update was at 11:38 AM ---------- This works perl -pi -e 's/100/test/g' * This does nt work perl -pi -e 's... (1 Reply)
Discussion started by: w020637
1 Replies

7. Shell Programming and Scripting

Search & Replace: Multiple Strings / Multiple Files

I have a list of files all over a file system e.g. /home/1/foo/bar.x /www/sites/moose/foo.txtI'm looking for strings in these files and want to replace each occurrence with a replacement string, e.g. if I find: '#@!^\&@ in any of the files I want to replace it with: 655#@11, etc. There... (2 Replies)
Discussion started by: spacegoose
2 Replies

8. Shell Programming and Scripting

Perl search multiple fields

Hi all, I have a flatfile 300 lines tiger,tampa10-pc,yellow,none,2013-02-25 08:56:51.000,2013-02-25 21:41:11.380,12hrs : 44min cat,tampa10-pc,white,none,2013-02-28 08:56:58.000,2013-03-04 23:18:23.003,110hrs : 21min dog,tampa10-pc,yellow,none,2013-03-05 09:50:17.000,2013-03-07... (5 Replies)
Discussion started by: sabercats
5 Replies

9. Shell Programming and Scripting

Search and Replace in multiple files

Hello, I have hundreds of files in which I need to change email address. Here is what I am trying to do: 1. All text files are in a directory "a" 2. In the text file, I want to replace email address for preparer. All these lines start with {{PreparerEmail and end with }}. The email... (3 Replies)
Discussion started by: cartrider
3 Replies

10. Shell Programming and Scripting

Replace 0 with 1 in multiple fields with awk

Hello, I have the following input file: 1 3 3 2 3 3 4 0 4 0 5 4 5 2 2 0 5 3 4 0 6 0 3 2 I am trying to remove all zeroes in fields 2 and 4 and replace them with "1's" I tried the following, but it's not working awk -F"\t" '{ if (($2==0) || ($4==0) $2=1; $4=1; print $0 ) }' input ... (8 Replies)
Discussion started by: Rabu
8 Replies
TTFDUMP(1)						      General Commands Manual							TTFDUMP(1)

NAME
ttfdump - Dumping the contents of a TrueType Font file SYNOPSIS
ttfdump [-h] [-t tablename] [-g glyphnumber] [-c collection] [-o dumpfile] [-i] ttfile DESCRIPTION
ttfdump dumps the contents of a TrueType font file in ASCII form. A TrueType font file is consist of various tables. Those table are divided into two categories - Required Tables and Optional Tables. Mulitiple TrueType fonts can be merged to a TrueType Collection. Options -h Print a help message on standard output and exit. -t tablename If this option is specified then dump the table "tablename", otherwise dump every tables in ttfile. Tablename can be one of the following: Required Tables cmap character to glyph mapping table glyf glyph data head font header hhea horizontal header hmtx horizontal metrics loca index to location maxp maximum profile name naming table post PostScript information OS/2 OS/2 and windows specific metrics Optional Tables cvt control value table fpgm font program; not implemented yet. gasp grid-fitting and scan conversion procedure (grayscale) hdmx horizontal device metrics kern kerning table LTSH Linear threshold table prep CVT program; not implemented yet PCLT PCL5 table VDMX Vertical Device Metrics table vhea vertical metrics header vmtx vertical metrics Additional OpenType Tables GPOS glyph positioning table GSUB glyph substitution table -g glyphnumber If this option is specified then dump the glyph with index glyphnumber, otherwise dump all glyphs in ttfile. -c collection Select a TrueType font in a TrueType Collection. -o dumpfile Output of the dump. If this option is not specified, dump to stdout. -i ttfile TrueType font file to be dumped. EXAMPLE
To dump all information in the TrueType font file times.ttf: ttfdump times.ttf To dump the required table cmap in the file: ttfdump -t cmap times.ttf To dump a single glyph with index 50: ttfdump -g 50 times.ttf SEE ALSO
TrueType 1.0 Font Files, Technical Specification Revision 1.66 November 1995 NOTE
Instruction disassembler in not implemented. AUTHOR
Li-Da Lho, ollie@ms1.hinet.net ILX Project 14 November 2011 TTFDUMP(1)
All times are GMT -4. The time now is 06:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy