Sponsored Content
Top Forums Shell Programming and Scripting extracting single charachters Post 9825 by jamsta on Sunday 4th of November 2001 09:34:06 AM
Old 11-04-2001
extracting single charachters

Hello!

brand new to unix (let alone scripting) I have come hit a step I can't seem to get around.

in a text file I have information such as :-

INFORM_USERS_IB COMPLETED llprod 20011003:100608

What I need to do is extract the 55th and 56t charachter, then insert a : then extract the 57th and 58th.. to give me an end result of:-
10:06

problem is how do I count of extract these charachters as they change frequently but *should* stay in the correct position??
(also does tab count as a single char?)

Or is there an easier way to reformat a date and time string?

Cheers,
James
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

max charachters for usernames

Can anyone tell me what the charachter maximum on a username is in SunOs 5.6. Thanks Mark (1 Reply)
Discussion started by: m.szylkarski
1 Replies

2. UNIX for Dummies Questions & Answers

Cutting the top two lines, and also charachters below.

Hey all. I have a file that I am trying to cut information out of. We have a script that shows us all of our Radio Scanners that are being used and I'm writing a script that clears all of the context off of the scanners. The script that runs shows us this information below... |emp_id ... (5 Replies)
Discussion started by: jalge2
5 Replies

3. Shell Programming and Scripting

Appending string (charachters inside the line) to a fixed width file using awk or sed

Source File: abcdefghijklmnop01qrstuvwxyz abcdefghijklmnop02qrstuvwxyz abcdefghijklmnop03qrstuvwxyz abcdefghijklmnop04qrstuvwxyz abcdefghijklmnop05qrstuvwxyz Whatever characters are in 17-18 on each line of the file, it should be concatenated to the same line at the character number... (6 Replies)
Discussion started by: tamahomekarasu
6 Replies

4. Shell Programming and Scripting

unzip single file and untar single file

Dear friends, My requirement below- 1] I have a zip file on unix server - ETL_Extracts_20100218175009.zip which is composed of various entity extracts namely... ENTITY1.txt, ENTITY2.txt, ENTITY3.txt etc.... How do I unzip only a single file ..say ENTITY2.txt from this zip file. CAn you... (2 Replies)
Discussion started by: sureshg_sampat
2 Replies

5. OS X (Apple)

Automated command ; extracting files from folders and copying them into a single folder

Hello everyone, I'm running Mac OS X Leopard (10.5.8) and I want to use the Terminal to help automate this tedious and laborious command for me: I need to extract all of the .m4p files in my "iTunes Music" folder which reside in folders of the artist, and then subfolders for the albums and... (2 Replies)
Discussion started by: qcom
2 Replies

6. Shell Programming and Scripting

Replace single quote with two single quotes in perl

Hi I want to replace single quote with two single quotes in a perl string. If the string is <It's Simpson's book> It should become <It''s Simpson''s book> (3 Replies)
Discussion started by: DushyantG
3 Replies

7. Shell Programming and Scripting

Multiple lines in a single column to be merged as a single line for a record

Hi, I have a requirement with, No~Dt~Notes 1~2011/08/1~"aaa bbb ccc ddd eee fff ggg hhh" Single column alone got splitted into multiple lines. I require the output as No~Dt~Notes 1~2011/08/1~"aaa<>bbb<>ccc<>ddd<>eee<>fff<>ggg<>hhh" mean to say those new lines to be... (1 Reply)
Discussion started by: Bhuvaneswari
1 Replies

8. Shell Programming and Scripting

Help extracting single instance of numbers which repeat

Hi, the title isn't very descriptive but it'll be easier to explain what I need if I write out the coordinates from which I need to extract certain information: ATOM 2521 C MAM X 61 44.622 49.357 12.584 1.00 0.00 C ATOM 2522 H MAM X 61 43.644 49.102 12.205 ... (10 Replies)
Discussion started by: crunchgargoyle
10 Replies

9. UNIX for Dummies Questions & Answers

Extracting combined differences based on a single column

Dear All, I have two sets of files. File 1 can be any number between 1 and 20 followed by a frequency of that number in a give documents... the lines in the file will be dependent to the analysed document. e.g. file1 1,5 4,1 then I have file two which is basicall same numbers but with... (2 Replies)
Discussion started by: A-V
2 Replies

10. Shell Programming and Scripting

Paste 2 single column files to a single file

Hi, I have 2 csv/txt files with single columns. I am trying to merge them using paste, but its not working.. output3.csv: flowerbomb everlon-jewelry sofft steve-madden dolce-gabbana-watchoutput2.csv: http://www1.abc.com/cms/slp/2/Flowerbomb http://www1.abc.com/cms/slp/2/Everlon-Jewelry... (5 Replies)
Discussion started by: ajayakunuri
5 Replies
CHARACTERDATA(1)					User Contributed Perl Documentation					  CHARACTERDATA(1)

NAME
XML::DOM::CharacterData - Common interface for Text, CDATASections and Comments DESCRIPTION
XML::DOM::CharacterData extends XML::DOM::Node The CharacterData interface extends Node with a set of attributes and methods for accessing character data in the DOM. For clarity this set is defined here rather than on each object that uses these attributes and methods. No DOM objects correspond directly to CharacterData, though Text, Comment and CDATASection do inherit the interface from it. All offsets in this interface start from 0. METHODS getData and setData (data) The character data of the node that implements this interface. The DOM implementation may not put arbitrary limits on the amount of data that may be stored in a CharacterData node. However, implementation limits may mean that the entirety of a node's data may not fit into a single DOMString. In such cases, the user may call substringData to retrieve the data in appropriately sized pieces. getLength The number of characters that are available through data and the substringData method below. This may have the value zero, i.e., Char- acterData nodes may be empty. substringData (offset, count) Extracts a range of data from the node. Parameters: offset Start offset of substring to extract. count The number of characters to extract. Return Value: The specified substring. If the sum of offset and count exceeds the length, then all characters to the end of the data are returned. appendData (str) Appends the string to the end of the character data of the node. Upon success, data provides access to the concatenation of data and the DOMString specified. insertData (offset, arg) Inserts a string at the specified character offset. Parameters: offset The character offset at which to insert. arg The DOMString to insert. deleteData (offset, count) Removes a range of characters from the node. Upon success, data and length reflect the change. If the sum of offset and count exceeds length then all characters from offset to the end of the data are deleted. Parameters: offset The offset from which to remove characters. count The number of characters to delete. replaceData (offset, count, arg) Replaces the characters starting at the specified character offset with the specified string. Parameters: offset The offset from which to start replacing. count The number of characters to replace. arg The DOMString with which the range must be replaced. If the sum of offset and count exceeds length, then all characters to the end of the data are replaced (i.e., the effect is the same as a remove method call with the same range, followed by an append method invocation). perl v5.8.0 2000-01-31 CHARACTERDATA(1)
All times are GMT -4. The time now is 01:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy