Search Results

Search found 2743 results on 110 pages for 'awk formatting'.

Page 4/110 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • combine 2 files with AWK based last colums

    - by mohammad reshad
    i have two files file1 ------------------------------- 1 a t p b 2 b c f a 3 d y u b 2 b c f a 2 u g t c 2 b j h c file2 -------------------------------- 1 a b 2 p c 3 n a 4 4 a i want combine these 2 files based last columns (column 5 of file1 and column 3 of file2) using awk result ---------------------------------------------- 1 a t p 1 a b 2 b c f 3 n a 2 b c f 4 4 a 3 d y u 1 a b 2 b c f 3 n a 2 b c f 4 4 a 2 u g t 2 p c 2 b j h 2 p c

    Read the article

  • Select a particular column using awk or cut or perl

    - by javed abbas
    Have a requirement to select the 7th column. eg: cat filename | awk '{print $7}' The issue is that the data in the 4th column has multiple values with blank in between. example - The last line in the below output: user \Adminis FL_vol Design 0 - 1 - group 0 FL_vol Design 19324481 - 3014 - user \MAK FL_vol Design 16875161 - 2618 - tree 826 FL_vol Out Global Doc Mark 16875162 - 9618 - /vol/FL_vol/Out Global Doc Mark

    Read the article

  • AWK -- How to do selective multiple column sorting?

    - by nawesita
    In awk, how can I do this: Input: 1 a f 1 12 v 2 b g 2 10 w 3 c h 3 19 x 4 d i 4 15 y 5 e j 5 11 z Desired output, by sorting numerical value at $5: 1 a f 2 10 w 2 b g 5 11 z 3 c h 1 12 v 4 d i 4 15 y 5 e j 3 19 x Note that the sorting should only affecting $4, $5, and $6 (based on value of $5), in which the previous part of table remains intact.

    Read the article

  • Optimizing grep (or using AWK) in a shell script

    - by Ode
    Hi - In my shell script, I am trying to search using terms found in a $sourcefile against the same $targetfile over and over. My $sourcefile is formatted as such: pattern1 pattern2 etc... The inefficient loop I have to search with is: for line in $(< $sourcefile);do fgrep $line $targetfile | fgrep "RID" >> $outputfile done I understand it would be possible to improve this by either loading the whole $targetfile into memory, or perhaps by using AWK? Thanks

    Read the article

  • how to use sed/awk to remove words with multiple pattern count

    - by user1461112
    I have a file of string records where one of the fields - delimited by "," - can contain one or more "-" inside it. The goal is to delete the field value if it contains more than two "-". i am trying to recoup my past knowledge of sed/awk but can't make much headway ========== info,whitepaper,Data-Centers,yes-the-6-top-problems-in-your-data-center-lane info,whitepaper,Data-Centers,the-evolution-center info,whitepaper,Data-Centers,the-evolution-of-lan-technology-lanner ========== expected outcome: info,whitepaper,Data-Centers info,whitepaper,Data-Centers,the-evolution-center info,whitepaper,Data-Centers thanks

    Read the article

  • Converting FASTQ to FASTA with SED/AWK

    - by neversaint
    I have a data in that always comes in block of four in the following format (called FASTQ): @SRR018006.2016 GA2:6:1:20:650 length=36 NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNGN +SRR018006.2016 GA2:6:1:20:650 length=36 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!+! @SRR018006.19405469 GA2:6:100:1793:611 length=36 ACCCGCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC +SRR018006.19405469 GA2:6:100:1793:611 length=36 7);;).;);;/;*.2>/@@7;@77<..;)58)5/>/ Is there a simple sed/awk/bash way to convert them into this format (called FASTA): >SRR018006.2016 GA2:6:1:20:650 length=36 NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNGN >SRR018006.19405469 GA2:6:100:1793:611 length=36 ACCCGCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC In principle we want to extract the first two lines in each block-of-4 and replace @ with >.

    Read the article

  • awk output to a file

    - by Harish
    I need help in moving the contents printed by awk to a text file. THis is a continuation of previous quesion I have to move all the contents into the same file so it is appending. To be specific nawk -v file="$FILE" 'BEGIN{RS=";"} /select/{ gsub(/.*select/,"select");gsub(/\n+/,"");print file,$0;} /update/{ gsub(/.*update/,"update");gsub(/\n+/,"");print file,$0;} /insert/{ gsub(/.*insert/,"insert");gsub(/\n+/,"");print file,$0;} ' "$FILE" How to get the print results to a text file appended one after the other in the same file?

    Read the article

  • Using AWK, treate files

    - by Mat
    Hi all, I have something to do that it must be finished before 4.00PM. I want create a batch file with awk, grep or sed that keep all lines beginning with 'INSERT' and delete the other lines. After this, i want replace a string "change)" by "servicechange)" when the 3rd word in the treated line is "donextsit". I don't know how to do this before my deadline (4.00 PM). Please HELP ME!! Thx for your answers. And Sorry for my english ;)

    Read the article

  • Substring extraction using bash shell scripting and awk

    - by rohanbk
    So, I have a file called 'dummy' which contains the string: "There is 100% packet loss at node 1". I also have a small script that I want to use to grab the percentage from this file. The script is below. result=`grep 'packet loss' dummy` | awk '{ first=match($0,"[0-9]+%") last=match($0," packet loss") s=substr($0,first,last-first) print s}' echo $result I want the value of $result to basically be 100% in this case. But for some reason, it just prints out a blank string. Can anyone help me?

    Read the article

  • awk / sed script to remove text

    - by radman
    Hi, I am currently needed of way to programmatically remove some text from Makefiles that I am dealing with. Now the problem is that (for whatever reason) the makefiles are being generated with link commands of -l<full_path_to_library>/<library_name> when they should be generated with -l<library_name>. So what I need is a script to find all occurrences of -l/ and then remove up to and including the next /. Example of what I'm dealing with -l/home/user/path/to/boost/lib/boost_filesystem I need it to be -lboost_filesystem As could be imagined this is a stop gap measure until I fix the real problem (on the generation side) but in the meantime it would be a great help to me if this could work and I am not too good with my awk and sed. Thanks for any help.

    Read the article

  • Tip#102: Did you know… How to specify tag specific formatting

    - by The Official Microsoft IIS Site
    Let’s see this with an example.  I have the following html code on my page. Now if I format the document by selecting Edit –> Format document (or Ctrl K, Ctrl D) The document becomes I want the content inside td should remain on the same line after formatting the document. Following steps would show how you can specify tag specific formatting for the Visual Studio editor Right click on the editor in an aspx file and select Formatting and Validation... (or alternatively you can go from Menu...(read more)

    Read the article

  • awk + sorting file according to values in the file and write two diffrent files

    - by yael
    hi I have in file file_test values of right eye and left eye How to separate the file_test to file1 and file2 by awk in order to write the equal values on file1 and different values on file2 as the following example down THX file_test: NAME: jim LAST NAME: bakker right eye: |5|< left eye VALUE: |5|< NAME: Jorg LAST NAME: mitchel right eye: |3|< left eye VALUE: |5|< NAME: jimmy LAST NAME: kartter right eye: |6|< left eye VALUE: |5|< NAME: david LAST NAME: kann right eye: |9|< left eye VALUE: |9|< file1: NAME: jim LAST NAME: bakker right eye: |5|< left eye VALUE: |5|< NAME: david LAST NAME: kann right eye: |9|< left eye VALUE: |9|< file2: NAME: Jorg LAST NAME: mitchel right eye: |3|< left eye VALUE: |5|< NAME: jimmy LAST NAME: kartter right eye: |6|< left eye VALUE: |5|<

    Read the article

  • use awk to identify multi-line record and filtering

    - by nanshi
    I need to process a big data file that contains multi-line records, example input: 1 Name Dan 1 Title Professor 1 Address aaa street 1 City xxx city 1 State yyy 1 Phone 123-456-7890 2 Name Luke 2 Title Professor 2 Address bbb street 2 City xxx city 3 Name Tom 3 Title Associate Professor 3 Like Golf 4 Name 4 Title Trainer 4 Likes Running Note that the first integer field is unique and really identifies a whole record. So in the above input I really have 4 records although I dont know how many lines of attributes each records may have. I need to: - identify valid record (must have "Name" and "Title" field) - output the available attributes for each valid record, say "Name", "Title", "Address" are needed fields. Example output: 1 Name Dan 1 Title Professor 1 Address aaa street 2 Name Luke 2 Title Professor 2 Address bbb street 3 Name Tom 3 Title Associate Professor So in the output file, record 4 is removed since it doen't have the "Name" field. Record 3 doesn't have Address field but still being print to the output since it is a valid record that has "Name" and "Title". Can I do this with awk? But how do i identify a whole record using the first "id" field on each line? Thanks a lot to the unix shell script expert for helping me out! :)

    Read the article

  • Uniq in awk; removing duplicate values in a column using awk

    - by D W
    I have a large datafile in the following format below: ENST00000371026 WDR78,WDR78,WDR78, WD repeat domain 78 isoform 1,WD repeat domain 78 isoform 1,WD repeat domain 78 isoform 2, ENST00000371023 WDR32 WD repeat domain 32 isoform 2 ENST00000400908 RERE,KIAA0458, atrophin-1 like protein isoform a,Homo sapiens mRNA for KIAA0458 protein, partial cds., The columns are tab separated. Multiple values within columns are comma separated. I would like to remove the duplicate values in the second column to result in something like this: ENST00000371026 WDR78 WD repeat domain 78 isoform 1,WD repeat domain 78 isoform 1,WD repeat domain 78 isoform 2, ENST00000371023 WDR32 WD repeat domain 32 isoform 2 ENST00000400908 RERE,KIAA0458 atrophin-1 like protein isoform a,Homo sapiens mRNA for KIAA0458 protein, partial cds., I tried the following code below but it doesn't seem to remove the duplicate values. awk ' BEGIN { FS="\t" } ; { split($2, valueArray,","); j=0; for (i in valueArray) { if (!( valueArray[i] in duplicateArray)) { duplicateArray[j] = valueArray[i]; j++; } }; printf $1 "\t"; for (j in duplicateArray) { if (duplicateArray[j]) { printf duplicateArray[j] ","; } } printf "\t"; print $3 }' knownGeneFromUCSC.txt How can I remove the duplicates in column 2 correctly?

    Read the article

  • AWK scripting :How to remove Field separator using awk

    - by anil-1985
    Need the following output ONGC044 ONGC043 ONGC042 ONGC041 ONGC046 ONGC047 from this input Medium Label Medium ID Free Blocks =============================================================================== [ONGC044] ECCPRDDB_FS_43 ac100076:4aed9b39:44f0:0001 195311616 [ONGC043] ECCPRDDB_FS_42 ac100076:4aed9b1d:44e8:0001 195311616 [ONGC042] ECCPRDDB_FS_41 ac100076:4aed9af4:4469:0001 195311616 [ONGC041] ECCPRDDB_FS_40 ac100076:4aed9ad3:445e:0001 195311616 [ONGC046] ECCPRDDB_FS_44 ac100076:4aedd04a:68c6:0001 195311616 [ONGC047] ECCPRDDB_FS_45 ac100076:4aedd4a0:6bf5:0001 195311616

    Read the article

  • Use Excel Color Scale Formatting with Text

    - by stumpylog
    I use Excel sheets to track the status of tasks through a set of discrete statuses. I'd like to be able to format these automatically, with the start being red, the end being green and progressing through the combination colors in the middle. Status1 (Red) Status2 (More Red than Green) Status3 (More Green than Red) Status4 (Green) The "Color Scales" option under Conditional Formatting seems like it could be made to work, but it wants numbers. So, my question, can it be done? Using conditional formatting or other formulas to achieve the desired affect?

    Read the article

  • Excel INDIRECT function and conditional formatting - highlighting a row

    - by Ehryk
    I'm having an issue with conditional formatting using the INDIRECT function. I'm doing something similar to Using INDIRECT and AND/IF for conditional formatting , but the only answer there isn't working for me. Basically, I want to highlight rows where B is not blank and F is blank. INDIRECT will work for ONE of the conditions, but = AND(INDIRECT("B"&ROW()) > 0, INDIRECT("F"&ROW()) = "") does not work at all. The answer in the question points to replacing the references with relative ones, so I'm thinking this should work: = AND ($B2 > 0, $F2 = "") But it does not, nor does ISBLANK($F@) or ISEMPTY($F2) (the cell contains a formula that sometimes will return "", I want the row highlighted in these cases but only when something is in column B). Am I missing something about relative references? Why doesn't INDIRECT work with AND/OR?

    Read the article

  • How to replace the nth column/field in a comma-separated string using sed/awk?

    - by Peter Meier
    assume I have a string "1,2,3,4" Now I want to replace, e.g. the 3rd field of the string by some different value. "1,2,NEW,4" I managed to do this with the following command: echo "1,2,3,4" | awk -F, -v OFS=, '{$3="NEW"; print }' Now the index for the column to be replaced should be passed as a variable. So in this case index=3 How can I pass this to awk? Because this won't work: echo "1,2,3,4" | awk -F, -v OFS=, '{$index="NEW"; print }' echo "1,2,3,4" | awk -F, -v OFS=, '{$($index)="NEW"; print }' echo "1,2,3,4" | awk -F, -v OFS=, '{\$$index="NEW"; print }' Thanks for your help!

    Read the article

  • Copy Excel Formatting the Easy Way with Format Painter

    - by DigitalGeekery
    The Format Painter in Excel makes it easy to copy the formatting of a cell and apply it to another. With just a few clicks you can reproduce formatting such as fonts, alignment, text size, border, and background color. On any Excel worksheet, click on the cell with the formatting you’d like to copy.  You will see dashed lines around the selected cell. Then select the Home tab and click on the Format Painter.   You’ll see your cursor now includes a paintbrush graphic. Move to the cell where you’d like to apply the formatting and click on it. Your target cell will now have the new formatting.   If you double-clicking on Format Painter you can then click on multiple individual files to which to apply the format. Or, you can click and drag across a group of cells. When you are finished applying formats, click on Format Painter again, or on the Esc key, to turn it off. The Format Painter is a very simple, but extremely useful and time saving tool when creating complex worksheets. Similar Articles Productive Geek Tips Use Conditional Formatting to Find Duplicate Data in Excel 2007Remove Text Formatting in Firefox the Easy WayMake Excel 2007 Always Save in Excel 2003 FormatUsing Conditional Cell Formatting in Excel 2007Make Word 2007 Always Save in Word 2003 Format TouchFreeze Alternative in AutoHotkey The Icy Undertow Desktop Windows Home Server – Backup to LAN The Clear & Clean Desktop Use This Bookmarklet to Easily Get Albums Use AutoHotkey to Assign a Hotkey to a Specific Window Latest Software Reviews Tinyhacker Random Tips DVDFab 6 Revo Uninstaller Pro Registry Mechanic 9 for Windows PC Tools Internet Security Suite 2010 New Firefox release 3.6.3 fixes 1 Critical bug Dark Side of the Moon (8-bit) Norwegian Life If Web Browsers Were Modes of Transportation Google Translate (for animals) Roadkill’s Scan Port scans for open ports

    Read the article

  • awk and cat - How to ignore multiple lines?

    - by Filipe YaBa Polido
    I need to extract Voip log from a D-Link router, so I've setup a little python script that executes a command in this router via telnet. My script does a "cat /var/log/calls.log" and returns the result, however... it also sends non-important stuff, like the BusyBox banner, etc... How can I ignore lines from 1 to 6 and the last 2 ? This is my current output: yaba@foobar:/stuff$ python calls.py BusyBox v1.00 (2009.04.09-11:17+0000) Built-in shell (msh) Enter 'help' for a list of built-in commands. DVA-G3170i/PT # cat /var/call.log 1 ,1294620563,2 ,+351xxx080806 ,xxx530802 ,1 ,3 ,1 DVA-G3170i/PT # exit And I just need: 1 ,1294620563,2 ,+351xxx080806 ,xxx530802 ,1 ,3 ,1 (it can have multiple lines) So that I can save it to a CSV and later to a sql db. Thanks, and sorry my bad english.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >