Finding a specific range of character in file


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Finding a specific range of character in file
# 1  
Old 03-08-2012
Finding a specific range of character in file

hi,

I want to store from 102 character to 128 character to a variable of header record which can be identified as 'HDR' which is the first 3 characters in the same line of a same.txt file.
Please advise.

Thanks

Last edited by techmoris; 03-08-2012 at 01:25 PM..
# 2  
Old 03-08-2012
Please clarify your requirements, give us an exemple of input you have and result you expect
# 3  
Old 03-08-2012
I was able to get it done..thanks..

Last edited by techmoris; 03-08-2012 at 03:37 PM..
# 4  
Old 03-09-2012
Because a forum is not only for asking but also for sharing, that could be nice for the others if you would post how you solved you problem, so anyone of the community encountering the same issue could take advantage of it.
# 5  
Old 03-13-2012
head -1 $filename|cut -c102-128
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Count specific character of a file in each line and delete this character in a specific position

I will appreciate if you help me here in this script in Solaris Enviroment. Scenario: i have 2 files : 1) /tmp/TRANSACTIONS_DAILY_20180730.txt: 201807300000000004 201807300000000005 201807300000000006 201807300000000007 201807300000000008 2)... (10 Replies)
Discussion started by: teokon90
10 Replies

2. UNIX for Dummies Questions & Answers

Search specific string logfile specific date range

Hi, I have logfile like this.. === 2014-02-09 15:46:59,936 INFO RequestContext - URL: '/eyisp/sc/skins/EY/images/pickers/comboBoxPicker_Over.png', User-Agent: 'Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko': Unsupported with Accept-Encoding header === 2015-02-09... (8 Replies)
Discussion started by: kishk
8 Replies

3. Shell Programming and Scripting

Reading specific range of columns in an Excel file

Hi All, I want to read an excel file. PFA excel, I want to read the cloumn from A to G and the V to AH starting from Row number 3. Please help me on this. (7 Replies)
Discussion started by: Abhisrajput
7 Replies

4. UNIX for Dummies Questions & Answers

Search for a specific String in a log file for a specific date range

Hi, I have log file which rolls out every second which is as this. HttpGenRequest - -<!--OXi dbPublish--> <created="2014-03-24 23:45:37" lastMsgId="" requestTime="0.0333"> <response request="getOutcomeDetails" code="114" message="Request found no matching data" debug="" provider="undefined"/>... (3 Replies)
Discussion started by: karthikprakash
3 Replies

5. Shell Programming and Scripting

Replace specific column range in a non-delimited file with a string!

Hi All, I will need an help with respect to replacing a range of columns on a non-delimited file using a particular string pattern. Say file input is MYNUMBERD000000-BAN CHUE INSNTS ** N+ MYAREDSDD000000+BAN CHUE INSNTS ** N+ MYDERFFFSD00000-GIR PENT - ACH ** ... (5 Replies)
Discussion started by: navojit dutta
5 Replies

6. Shell Programming and Scripting

finding file with a specific range

Hi All, Thanks in advance File is generated with following format 31000000.xml to 48999999.xml 74000000.xml to 88999999.xml Above range should be find and moved into the folder named abc and below is another range should should be find and moved into folder named xyz ... (1 Reply)
Discussion started by: sujit_kashyap
1 Replies

7. Shell Programming and Scripting

File character adjustment based on specific character

i have a reqirement to adjust the data in a file based on a perticular character the sample data is as below 483PDEAN CORRIGAN 52304037528955WAGES 50000 89BP ABCD MASTER352 5434604223735428 4200 58BP SOUTHERN WA848 ... (1 Reply)
Discussion started by: pema.yozer
1 Replies

8. Shell Programming and Scripting

Search for a specific data in a file based on a date range

Hi, Currently I am working on a script to automate the process of converting the log file from binary into text format. To achieve this, partly I am depending on my application’s utility for this conversion and the rest I am relying on shell commands to search for directory, locate the file and... (5 Replies)
Discussion started by: svajhala
5 Replies

9. Shell Programming and Scripting

Finding file in specific subdirectories

Hi experts problem: i have a directory "DATA" with lots of subdirectories named as date with hudge data containning files. Directory = "DATA" subdirectory = "20090611" & "20090612" ...... 20090611 = thousands of files i wanna apply find command to find all files in... (3 Replies)
Discussion started by: The_Archer
3 Replies

10. Shell Programming and Scripting

Read Write byte range/chunk of data from specific location in file

I am new to Unix so will really appreciate if someone can guide me on this. What I want to do is: Step1: Read binary file - pick first 2 bytes, convert from hex to decimal. Read the next 3 bytes as well. 2 bytes will specify the number of bytes 'n' that I want to read and write... (1 Reply)
Discussion started by: Kbenipel
1 Replies
Login or Register to Ask a Question