Sponsored Content
Full Discussion: Mapping two files
Top Forums Shell Programming and Scripting Mapping two files Post 302731781 by goddevil on Thursday 15th of November 2012 08:12:25 PM
Old 11-15-2012
Quote:
Originally Posted by bipinajith
Using shell script:-
Code:
IFS=","
while read pr1 pr2
do
    sed "s/$pr2/$pr1/g" mainfile.csv > tmp; mv tmp mainfile.csv;
done < reffile

Cheers bipi.

I am looking for a way to map the code to the specific column as there may be other columns with the same characters and i would not like them touched.

For eg:
Code:
test1234,,real,,TRY97837290,,open,,,,EU,,,,23/03/2012 12:03:00,,,,GB,,,,1187,0,B,TRY     ,10000,15/07...
test1234,,real,,FDG09789238,,open,,,,EU,,,,23/03/2012 12:03:00,,,,GB,,,,1187,0,B,FDG           ,10000,15/07...
test1234,,real,,HGC02749267,,open,,,,EU,,,,23/03/2012 12:03:00,,,,GB,,,,1187,0,B,HGC          ,10000,15/07...
test1234,,real,,MDL92773671,,open,,,,EU,,,,23/03/2012 12:03:00,,,,GB,,,,1187,0,B,MDL           ,10000,15/07...

I suppose the fault is mine. I wasnt clear with my initial requirement as to why i am choosing this avenue of replacing a column. Apologies
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Join 3 files using key column in a mapping file

I'm new of UNIX shell scripting. I'm recently generating a excel report in UNIX(file with delimiter is fine). How should I make a script to do it? 1 file to join comes from output of one UNIX command, the second from another UNIX command, and third from a database query. The key columes of all... (7 Replies)
Discussion started by: bigsmile
7 Replies

2. Shell Programming and Scripting

Mapping and replacing numbers in two files

hi i have two files one of the form 1 2 2 45 3 56 4 98 5 6598 6 98 7 10 8 0 9 15 10 56 This file's significance is that it maps the number in first column to that of the number in second column The other file is of the form 1 2 (1 Reply)
Discussion started by: vaibhavkorde
1 Replies

3. UNIX for Dummies Questions & Answers

Re-Mapping Printers.

Hi we have a situation where some printers are on a server that sometimes has to be rebooted. If this happens the Unix boxes we have that are referencing the printers in the vfstab file fail to work even when the print server is brought back up. Does anyone know if it would be possible to put... (0 Replies)
Discussion started by: Hadleyshope
0 Replies

4. Shell Programming and Scripting

Need Help Mapping Arrays

I have the following arrays with different lengths that I want to map them with the same key. # Week numbers, 8 columns @headers = ("2011-34", "2011-35", "2011-36", "2011-37", "2011-38", "2011-39", "2011-40", "2011-41"); %data = ("2011-34", BCE, "2011-35", YZA, "2011-36",... (5 Replies)
Discussion started by: tqlam
5 Replies

5. Shell Programming and Scripting

Creating unique mapping from multiple mapping

Hello, I do not know if this is the right title to use. I have a large dictionary database which has the following structure: where a b c d e are in English and p q r s t are in a target language., the two separated by the delimiter =. What I am looking for is a perl script which will take... (5 Replies)
Discussion started by: gimley
5 Replies

6. UNIX for Advanced & Expert Users

Help With Mapping machine

Hi All, I need an urgent assistance please . My case below: I have a list of 500 IP addresses. All These ip addresses are mapped/connected to different machine kinds : NT, Linux, Switch, Router ,FW, and so on. My Requirement is to filter from all this ip address only the Linux... (0 Replies)
Discussion started by: James Stone
0 Replies

7. Shell Programming and Scripting

Mapping Servers

Hi All, I need an urgent assistance please . My case below: I have a list of 500 IP addresses. All These ip addresses are mapped/connected to different machine kinds : NT, Linux, Switch, Router ,FW, and so on. My Requirement is to filter from all this ip address only the Linux machines.... (2 Replies)
Discussion started by: James Stone
2 Replies

8. UNIX for Dummies Questions & Answers

Loop Through Files in Order and mapping

Hi there, How can I loop through files with order. I tried using ls .html | sort -v However the filename is with spaces:1233.61.47.0 - 121.61.123.112 nexpose.html Here is the original code that is working well, but I need to sort through the filename.echo "<center>" for file in *.html... (2 Replies)
Discussion started by: alvinoo
2 Replies

9. UNIX for Advanced & Expert Users

Mapping Oracle SGA memory into physical files in Solaris.

Is there a way by which we could map Oracle SGA memory into physical files in solaris. We could find these physical files in /dev/shm/ folder in linux environment but they are missing in solaris. (1 Reply)
Discussion started by: arjun_chauhan
1 Replies

10. Shell Programming and Scripting

Many to many -- mapping

INPUT 13333--TEXT1 14444--TEXT2 13333--TEXT3 12233--TEXT5 14444--TEXT5 12233--TEXT1 12222--TEXT5 13333--TEXT09 what I'm looking for is something using awk arrays with below given output. 14444--TEXT2,TEXT5 13333--TEXT1,TEXT3,TEXT09 12233--TEXT5,TEXT1 12222--TEXT5 (6 Replies)
Discussion started by: busyboy
6 Replies
ppmtosixel(1)						      General Commands Manual						     ppmtosixel(1)

NAME
ppmtosixel - convert a portable pixmap into DEC sixel format SYNOPSIS
ppmtosixel [-raw] [-margin] [ppmfile] DESCRIPTION
Reads a portable pixmap as input. Produces sixel commands (SIX) as output. The output is formatted for color printing, e.g. for a DEC LJ250 color inkjet printer. If RGB values from the PPM file do not have maxval=100, the RGB values are rescaled. A printer control header and a color assignment table begin the SIX file. Image data is written in a compressed format by default. A printer control footer ends the image file. OPTIONS
-raw If specified, each pixel will be explicitly described in the image file. If -raw is not specified, output will default to com- pressed format in which identical adjacent pixels are replaced by "repeat pixel" commands. A raw file is often an order of magni- tude larger than a compressed file and prints much slower. -margin If -margin is not specified, the image will be start at the left margin (of the window, paper, or whatever). If -margin is speci- fied, a 1.5 inch left margin will offset the image. PRINTING
Generally, sixel files must reach the printer unfiltered. Use the lpr -x option or cat filename > /dev/tty0?. BUGS
Upon rescaling, truncation of the least significant bits of RGB values may result in poor color conversion. If the original PPM maxval was greater than 100, rescaling also reduces the image depth. While the actual RGB values from the ppm file are more or less retained, the color palette of the LJ250 may not match the colors on your screen. This seems to be a printer limitation. SEE ALSO
ppm(5) AUTHOR
Copyright (C) 1991 by Rick Vinci. 26 April 1991 ppmtosixel(1)
All times are GMT -4. The time now is 01:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy