Sponsored Content
Top Forums Shell Programming and Scripting command to remove multiple commands in particular columns Post 302531615 by yazu on Friday 17th of June 2011 09:53:07 AM
Old 06-17-2011
Code:
% cat testfile                                                
first,"Street1,City1,Country1",test1
second,"Street2,City2","test2"
third,"Street3,City3,Country3","A,B,C,D,E"
fourth,"A,B,C,D,E",test4"

% cat testfile | perl -lpe 's/("[^"]+")/($temp=$1) =~ s|,||g && $temp/e'
first,"Street1City1Country1",test1
second,"Street2City2","test2"
third,"Street3City3Country3","A,B,C,D,E"
fourth,"ABCDE",test4"

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Command to run multiple commands from a file.

I need a command, which could run mutliple commands from a file. Let's say, I have mv fileA1 fileB1 mv fileA2 fileB2 ..... mv fileA20 fileB20 I put these commands in a file, then I need a command to run the file as a whole so that I don't need to type 20 times... Anyone tell me how to... (8 Replies)
Discussion started by: kaixinsjtu
8 Replies

2. Shell Programming and Scripting

Single command for add 2 columns and remove 2 columns in unix/performance tuning

Hi all, I have created a script which adding two columns and removing two columns for all files. Filename: Cust_information_1200_201010.txt Source Data: "1","Cust information","123","106001","street","1-203 high street" "1","Cust information","124","105001","street","1-203 high street" ... (0 Replies)
Discussion started by: onesuri
0 Replies

3. Shell Programming and Scripting

awk command to print multiple columns

Hello Team, I have written following command which is giving output is as shown below. bash-3.00$ grep -i startup catalina.out | tail +2 | sed -n 1p | awk -F" " '{ for (x=1; x<=5; x++) { printf"%s\n", $x } }' Dec 19, 2010 3:28:39 PM bash-3.00$ I would like to modify above command to... (2 Replies)
Discussion started by: coolguyamy
2 Replies

4. Shell Programming and Scripting

sed remove multiple set of lines in one command

is there a way with sed to removed more than one set of lines in one line? so i mean sed ${firstElem},${lastIndex}d web.xml > web1.xml this will delete lines between ${firstElem},${lastIndex} i want in the same line to do somethinkg like this (doesn't work so far) sed... (3 Replies)
Discussion started by: Poki
3 Replies

5. UNIX for Dummies Questions & Answers

Using sed command to remove multiple instances of repeating headers in one file?

Hi, I have catenated multiple output files (from a monte carlo run) into one big output file. Each individual file has it's own two line header. So when I catenate, there are multiple two line headers (of the same wording) within the big file. How do I use the sed command to search for the... (1 Reply)
Discussion started by: rebazon
1 Replies

6. Shell Programming and Scripting

perform 3 awk commands to multiple files in multiple directories

Hi, I have a directory /home/datasets/ which contains a bunch (720) of subdirectories called hour_1/ hour_2/ etc..etc.. in each of these there is a single text file called (hour_1.txt in hour_1/ , hour_2.txt for hour_2/ etc..etc..) and i would like to do some text processing in them. Each of... (20 Replies)
Discussion started by: amarn
20 Replies

7. Shell Programming and Scripting

Remove Duplicate by considering multiple columns

hi friends, my input chr1 exon 35204 35266 gene_id "GOLGB1"; transcript_id "GOLGB1"; chr1 exon 42357 42473 gene_id "GOLGB1"; transcript_id "GOLGB1"; chr1 exon 45261 45404 gene_id "GOLGB1"; transcript_id "GOLGB1"; chr1 exon 50701 50778 gene_id "GOLGB1"; transcript_id "GOLGB1";... (2 Replies)
Discussion started by: jacobs.smith
2 Replies

8. Shell Programming and Scripting

Remove Duplicates on multiple Key Columns and get the Latest Record from Date/Time Column

Hi Experts , we have a CDC file where we need to get the latest record of the Key columns Key Columns will be CDC_FLAG and SRC_PMTN_I and fetch the latest record from the CDC_PRCS_TS Can we do it with a single awk command. Please help.... (3 Replies)
Discussion started by: vijaykodukula
3 Replies

9. Shell Programming and Scripting

Issue with running multiple commands withing su command

RHEL 6.2/Bash shell root user will be executing the below script. It switches to oracle user and expect to do the following things A. Source the environment variables for BATGPRD Database (the file used for sourcing is shown below after the script) B. Shutdown the DB from sqlplus -- The... (13 Replies)
Discussion started by: omega3
13 Replies

10. UNIX for Advanced & Expert Users

Pass Multiple Commands and Open Multiple Xterms via PSS

Hello, I'm attempting to open multiple xterms and run a command as an SAP user via sudo using PSSH. So far, I'm able to run PSSH to a file of servers with no check for keys, open every xterm in to the servers in the file list, and SUDO to the SAP(ADM) user, but it won't do anything else... (11 Replies)
Discussion started by: icemanj
11 Replies
rendercheck(1)						      General Commands Manual						    rendercheck(1)

NAME
rendercheck - simple tests of the X Render extension. SYNOPSIS
rendercheck [-d|--display display] [-i|--iter] [--sync] [-t|--tests test1,test2,test3,...] [-o|--ops op1,op2,op3,...] [-v|--verbose] [--minimalrendering] DESCRIPTION
rendercheck is a set of simple tests of the X Render extension. It is designed for authors of Render implementations in X Servers. OPTIONS
-d|--display display Specifies the display to test against. -i|--iter iterations Specifies the number of times to repeat each operation before sampling results. Some X Servers may behave differently (hardware vs software rendering paths) depending on the previous operations done, so this may be used to influence the server's choices. --sync Enables synchronous xlib operation, for debugging. -t|--tests test1,test2,test3... Enables only a specific subset of the possible tests. Test names include fill, dcoords, scoords, mcoords, tscoords, tmcoords, blend, composite, cacomposite, gradients, repeat, triangles, and bug7366. Names must be separated by commas and have no spaces. -f|--formats format1,format2,format3... Enables only a specific subset of the possible formats. Only formats listed in the server-supported format list are available. Names must be separated by commas and have no spaces. -o|--ops Enables only a specific subset of the Render operators. -v|--verbose Enables verbose printing of information on tests run, and successes and failures. --minimalrendering Disables copying of offscreen destinations to the window, which is on by default to provide the user with visual feedback. BUGS
Several limitations are documented in the TODO file accompanying the source. Please report any further bugs you find to http://bugs.freedesktop.org/. AUTHORS
Eric Anholt, with help from Keith Packard. rendercheck(1)
All times are GMT -4. The time now is 07:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy