Sponsored Content
Full Discussion: Question on cut
Top Forums UNIX for Dummies Questions & Answers Question on cut Post 302663619 by Scrutinizer on Thursday 28th of June 2012 10:02:29 AM
Old 06-28-2012
Note: with read you can use IFS local to the read command, so that you do not need to globally set/reset IFS :
Code:
IFS=: read field1 field2 field3 field4 < x.dat


Last edited by Scrutinizer; 06-28-2012 at 11:11 AM..
This User Gave Thanks to Scrutinizer For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

cut question

#!/bin/bash echo "UserName PID Command" ps -ef > ps.temp grep '^\{2,3\}\{4\}' ps.temp > ps.temp2 cut -f1,2,8 ps.temp2 rm ps.temp* I am having some problems with the cut command. I only want to display the UID (field 1), PID(field 2), and Command(field 8). Right now the whole ps -ef... (5 Replies)
Discussion started by: knc9233
5 Replies

2. Shell Programming and Scripting

Cut -d Question

I went through quite a few threads and didn't find anything on this. I also looked on other sites and couldn't turn up an answer. For completeness sake, I'm working off of solaris 10 in the korn shell environment. I wrote a script for a buddy to help him out with the following issue. He... (12 Replies)
Discussion started by: Janus
12 Replies

3. Shell Programming and Scripting

SED and Cut question

I am trying to cut and delete using sed and redirect back into the file. This is not working write. When testing the script, it hangs. Any idea what I am doing wrong here. ################ Reads the input file to cut volumes for returns and CUT_ERVTAPE_FILE() { echo "working on cut... (2 Replies)
Discussion started by: gzs553
2 Replies

4. Shell Programming and Scripting

sort / cut question

Hi All, I have a small problem, hope you can help me out here. I have a file that contains the same format of lines in 99% of the cases. 906516 XYZ.NNN V 0000 20070711164648 userID1 userID2 hostname 20070711164641 There are unfortunately several lines with these... (5 Replies)
Discussion started by: BearCheese
5 Replies

5. Shell Programming and Scripting

The cut command. Really simple question!

hi, sorry for asking what I am sure is a really easy question, I am wanting to cut the users real name from the output of 'finger'. $ cut -f2-3 filename is in my script but it only seems to cut the first line. I need to cut the 2nd and 3rd word from each line and store them in variables... (1 Reply)
Discussion started by: rorey_breaker
1 Replies

6. UNIX for Dummies Questions & Answers

Cut Question

Hi, I have created a variable abc within my script which can have values as follows abc = Ram,Iam or it can be abc = Uam or it can be abc = Sam,Tam,Pam Basically it can have a max of 3 values , seperated by comma. I want to assign these 3 values to 3 different variables In case of... (2 Replies)
Discussion started by: samit_9999
2 Replies

7. UNIX for Dummies Questions & Answers

cut awk dummy question :)

how to make cut and awk treat "a b" as a single column rather then two separate columns "a and b"? how to remove " symbol from "a b" so there is only a b? Please help Regards Karol (14 Replies)
Discussion started by: sopel39
14 Replies

8. UNIX for Dummies Questions & Answers

Question on the cut command

Suppose one has a file consisting of more than 2 columns and one has to extract a few columns from this file and swap some columns at the same time. Example: extract column 1, 2 and 4 from a file foo.csv and place them in the order 2, 4 and 1 into file foo.txt. I would be inclined to do this: cut... (4 Replies)
Discussion started by: figaro
4 Replies

9. Shell Programming and Scripting

Simple Cut Question

I've got a file that contains a large list of links in this type of style: 'home_dir\2009\09\01\file.html' I'd like to cut off all of the characters left of 'file.html'. I tried: cat file.txt | cut -d\ -f4 but it told me that I had an invalid delimiter. So I tried: cat... (5 Replies)
Discussion started by: Rally_Point
5 Replies

10. Shell Programming and Scripting

A question on cut

hi, I used cut to get the I have a file f1 with content: 101.2 ms RTT from 3WHS 95.2 ms RTT from 3WHS 97.3 ms RTT from 3WHS 97.4 ms RTT from 3WHS 122.2 ms RTT from 3WHS 103.5 ms RTT from... (2 Replies)
Discussion started by: esolve
2 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 12:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy