01-29-2010
How to cut a flat file according to a certain number of characters?
hello everybody
i am looking for a shell to cut a flat file (with a long unique line) according to a certain number of characters and redirect every result to an output file.
here is an example
MyFile :
12 3 456 12 3 456 12 3 456 .....
and i took every 9-characters including BLANKS in MyFile
so the ouput file OutFile will be like that
12 3 456
12 3 456
12 3 456
.......
i have flat files with an average of 2 Millions of characters that's why i really want to do it with a shell
Tried with awk, cut and sed but i am not really a specialist so if there is a clue just answer me cause i am in a hurry to find a solution
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I was wondering if somebody could help me with something on UNIX. I have a file that looks like this -
"nelson,bill","bill","123 Main St","Mpls","MN",55444,8877,william
I want to replace all comma with pipes (|), except if the comma is within double quotes. (The first field is an example of... (8 Replies)
Discussion started by: nelson553011
8 Replies
2. UNIX for Advanced & Expert Users
Hey,
Is there anyway I anks,
Pocha (12 Replies)
Discussion started by: pochaman
12 Replies
3. Shell Programming and Scripting
Hi
I have the fixed width flat file having the following data
12345aaaaaaaaaabbbbbbbbbb
12365sssssssssscccccccccc
12365sssss
12367ddddddddddvvvvvvvvvv
12367 vvvvv
Here the first column is length 5 second is length 10 third is length 10
if the second or third column exceeds... (3 Replies)
Discussion started by: Brado
3 Replies
4. Shell Programming and Scripting
Hi All,
Need to convert file names to upper case using tr command in Unix.
In a folder -> /apps/dd01/misc
there are two files like:
pi-abcd567sd.pdf
pi-efgh1.pdf
The output of should be like:
pi-ABCD567SD.pdf
pi-EFGH1.pdf
I have used the command to work as below:
for f... (3 Replies)
Discussion started by: a1_win
3 Replies
5. Shell Programming and Scripting
Guys,
can you help me in doing cut first 21 and 32-35 characters from file.
I tried with cut -c to cut first 21 characters ,It is succeeded.
But i need both first 21 and 32-35. (1 Reply)
Discussion started by: mohan_xunil
1 Replies
6. Shell Programming and Scripting
Hello Guys
Please help me with the below issue
I want to read a flat file source upto certain number of columns
Say my flat file has 30 columns but I want to read upto 25 columns only
How come the above issue can be addressed?
Thanks a lot!!!! (1 Reply)
Discussion started by: Pratik4891
1 Replies
7. UNIX for Dummies Questions & Answers
I have a csv flatfile with a few million rows. I need to replace a field (field number is 85) in the file with a sequential number.
As an example, let's assume there are only 4 fields in the file:
A,A,,32
A,A,,27
A,B,,43
C,C,,354
If I wanted to amend the 3rd field in this way my... (2 Replies)
Discussion started by: BristolSmithy
2 Replies
8. UNIX for Dummies Questions & Answers
HI,
can any one help me please ..
i have flat file like
qwer123rt ass3242ccf jjk654
kjh838ppp nhdg453ok hdkk34
i want remove numeric characters in the flat file
i want output like this
qwerrt assccf jjk
kjhppp nhdgok hdkk
help me... (4 Replies)
Discussion started by: rafimd1985
4 Replies
9. Shell Programming and Scripting
Hi,
Is there a way to find out the line number from where the data starts?
like if the data contains column header, irrespective of the text in the column header we should get the line number from which contains the column header.
I am sorry if I haven't explained the problem clearly.
... (8 Replies)
Discussion started by: kedar_laveti
8 Replies
10. Shell Programming and Scripting
Hi....I need one help....
I'm having a files which is having the data as follows...
a
b
c c
d d d
e
f
Now I need to find out distinct characters from this file and the output should be as follows -
a
b
c
d
e
f
Can you please help me on this? I'm using KSH script. (18 Replies)
Discussion started by: Krishanu Saha
18 Replies
LEARN ABOUT REDHAT
strokes
STROKES(5) File Formats Manual STROKES(5)
NAME
Strokes - X(1) action invocation with simple mouse movements
DESCRIPTION
What are strokes? Simply put, they are a method to invoke program actions with mouse drags. They are defined by the following grid:
1 2 3
4 5 6
7 8 9
Stroke 456 is the horizontal movement from left to right with the stroke button pressed. Holding down the stroke button and tracing out
the letter `C' would be stroke 3214789. Simple, right?
The Stroke library allows you to add strokes to any X(1) program with one simple function call, StrokeInstall(3). For example:
W = XmCreateMessageDialog(Parent,
"StrokeEnabledDialog",
NULL, 0);
StrokeInstall(W);
will enable strokes in the dialog W.
When a stroke is entered the action corresponding to the stroke is called. For the above example the action `Stroke-456' would be called
when `456 is stroked'.
In order to specify a different action you can specify this with the `strokes' resource for the Widget that the strokes have been installed
in. So `*StrokeEnabledDialog.strokes: 456 ManagerGadgetSelect' would call the ManagerGadgetSelect action of the message dialog when 456 is
stroked. The exact syntax is:
Resource.strokes: stroke action [[,stroke action]...]
Resources
strokes: stroke action [[,stroke action]...]
This provides a mapping of strokes to actions. By default the action `Stroke-456' is called for stroke `456'.
strokeSlop: int
This is used to define a buffer zone between the boxes of the grid. The amount of slop tolerated is actually the resulting box
dimension divided by this slop number. Therefore the larger the slop number the more accurate your strokes must be. A value
approaching 3 will make it all but impossible to recognize a stroke. The default value is currently 20. Run the stroke(1) program
with StrokeDebug turned on to show what this means.
strokeDebug: True | False
Turns on `stroke debug mode'. In this mode the strokes are not erased from the screen when the button is released and a grid is
drawn around the stroke. Try the stroke(1) program to see what I mean.
strokeButton: 1 | 2 | 3 | 4 | 5
Specifies the button to be used to draw strokes. By default Btn3 is used.
strokeSound: sound file
If given, the contents of this resource will be provided as an argument to the `PlaySound' action at the conclusion of the stroke.
If the PlaySound action is not defined in your application do not specify this resource. Specifically the following call is made:
XtCallActionProc(W, "PlaySound", NULL, "sound file", 1);
AUTHOR
Rick Scott <rwscott@alumni.uwaterloo.ca>
Check out LessTif at http://www.LessTif.org
SEE ALSO
stroke(1) StrokeInstall(3) StrokeRemove(3) StrokeSetButton(3) StrokeGetButton(3) StrokeSetDebug(3) StrokeGetDebug(3) StrokeSetMapping(3)
StrokeGetMapping(3)
STROKES(5)