Sponsored Content
Top Forums Shell Programming and Scripting Splitting based on occurence of a Character at fixed position Post 302835011 by cfajohnson on Sunday 21st of July 2013 10:38:13 AM
Old 07-21-2013
Code:
position=18
char=D

awk -v p="$position" -v c="$char" '
BEGIN { basefile = "txt"; filename = basefile "" ++x }
{print > filename}
(substr($0,p,1) == c) { filename = basefile "" ++x }
' "$file"

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sorting a flat file based on multiple colums(using character position)

Hi, I have an urgent task here. I am required to sort a flat file based on multiple columns which are based on the character position in that line. I am restricted to use the character position instead of the space and sort +1 +2 etc to do the sorting. I understand that there is a previous... (8 Replies)
Discussion started by: cucubird
8 Replies

2. Shell Programming and Scripting

Append line based on fixed position

Hi all; I'm having headache on append one line to another based on the fix position.Hope u guys can help. All i need to do is append the line that start with '3' to a line which start with '1' and the position for line 3 that i need to append is 22. The original file look like this: ... (2 Replies)
Discussion started by: ashikin_8119
2 Replies

3. Shell Programming and Scripting

Cut multiple data based on character position

How to extract multiple data based on character position. I need to fetch from 7-9 and 22-26 and there is no delimiter for 22-26 since it is part of the column. The file may have more than 1000 character long.I managed to pull any one but not both for example test data 12345 zxc vbnmlk... (1 Reply)
Discussion started by: zooby
1 Replies

4. UNIX for Dummies Questions & Answers

Using grep to check for character at fixed position

i have a file (test.txt) that contains: 20799510617900000928000000005403020110315V 20799510617900000928000000005403020110316 20799510617900000928000000005403020110317 20799510617900000928000000005403020110318V grep V test.txt > /tmp/void.log if then mail -s "void" < test.txt fi... (2 Replies)
Discussion started by: tjmannonline
2 Replies

5. Linux

Linux script to remove a character in a file based on position.

Greetings, We have a requirement where we need to loop in a fixed width file in linux and remove a character based on a position for every record. It would highly appreciate if someone can help to automate this. Appreciate your time and help! Regards (3 Replies)
Discussion started by: mailme0205
3 Replies

6. Shell Programming and Scripting

Splitting file based on pattern and first character

I have a file as below pema.txt s2dhshfu dshfkdjh dshfd rjhfjhflhflhvflxhvlxhvx vlvhx sfjhldhfdjhldjhjhjdhjhjxhjhxjxh sjfdhdhfldhlghldhflhflhfhldfhlsh rjsdjh#error occured# skjfhhfdkhfkdhbvfkdhvkjhfvkhf sjkdfhdjfh#error occured# my requirement is to create 3 files frm the... (8 Replies)
Discussion started by: pema.yozer
8 Replies

7. UNIX for Dummies Questions & Answers

Change a character based on its position number

Hi I have a text file that I want to change some of the characters based on their position. My file contain multiple lines and characters should be counted continuously line by line. For example, I want to convert the 150th T to C. What can I do? Here is a portion of my file:... (10 Replies)
Discussion started by: a_bahreini
10 Replies

8. Shell Programming and Scripting

Fixed width file search based on position value

Hi, I am unable to find the right option to extract the data in the fixed width file. sample data abcd1234xgyhsyshijfkfk hujk9876 io xgla loki8787eljuwoejroiweo dkfj9098 dja Search based on position 8-9="xg" and print the entire row output ... (4 Replies)
Discussion started by: onesuri
4 Replies

9. Shell Programming and Scripting

Search for a string at a particular position and replace with blank based on position

Hi, I have a file with multiple lines(fixed width dat file). I want to search for '02' in the positions 45-46 and if available, in that lines, I need to replace value in position 359 with blank. As I am new to unix, I am not able to figure out how to do this. Can you please help me to achieve... (9 Replies)
Discussion started by: Pradhikshan
9 Replies

10. UNIX for Beginners Questions & Answers

Splitting the file based on two fields - Fixed length file

Hi , I am having a scenario where I need to split the file based on two field values. The file is a fixed length file. ex: AA0998703000000000000190510095350019500010005101980301 K 0998703000000000000190510095351019500020005101480 ... (4 Replies)
Discussion started by: saj
4 Replies
mdassembler(1)						      General Commands Manual						    mdassembler(1)

NAME
mdassembler - Compile documentation for use in monodoc browser SYNOPSIS
mdassembler OPTIONS* DIRS+ DESCRIPTION
mdassembler has been obsoleted by mdoc(1). See the mdoc-assemble(1) man page. mdassembler is a program that creates .tree and .zip files for use in the monodoc documentation browser. The .tree and .zip files are copied into monodoc's sources directory, and reside with a .source file which is used by monodoc to specify where the documentation should be displayed. The .source file's /monodoc/source/@basefile attribute specifies the filename prefix for the documentation files. This must be the same prefix as used with the --out parameter. OPTIONS
--ecma The documentation found within DIRS is in the Mono ECMA documentation format. See the Mono ECMA Documentation Format section below. --ecmaspec The documentation found within DIRS is in the ECMA Specification documentation format. See the Mono ECMA Specification Documenta- tion Format section below. --error The documentation found within DIRS is in "error" format. See the Error Documentation Format section below. --help Show program argument information. --man The documentation found within DIRS is in man page format. See the Man Page Documentation Format section below. -o, --out PREFIX Specify the output file prefix. mdassembler creates the files PREFIX.zip and PREFIX.tree . --simple The documentation found within DIRS is in "simple" format. See the Simple Documentation Format section below. --xhtml, --hb The documentation found within DIRS is in XHTML format. See the XHTML Documentation Format section below. FORMATS
The following documentation formats are supported: Mono ECMA Documentation Format An XML documentation format with one file per type. See the mdoc(5) man page for more information. Mono ECMA Specification Documentation Format This is not the format you're looking for. This is the format used to represent the ECMA-334 (C#) standard within monodoc. It is not used to display class library documentation; for class library documentation, use the --ecma format. Error Documentation Format Used to present detailed error messages, and is used in monodoc's "C# Compiler Error Reference" tree. DIRS is not a directory, but is instead a configuration file, containing the XML: <ErrorProviderConfig> <FilesPath>../../mcs/errors</FilesPath> <Match>cs????*.cs</Match> <ErrorNumSubstringStart>2</ErrorNumSubstringStart> <ErrorNumSubstringLength>4</ErrorNumSubstringLength> <FriendlyFormatString>CS{0:0###}</FriendlyFormatString> </ErrorProviderConfig> /ErrorProviderConfig/FilesPath specifies where to look for files, /ErrorProviderConfig/Match specifies the filename pattern to look for within /ErrorProviderConfig/FilesPath, /ErrorProviderConfig/ErrorNumSubstringStart and /ErrorProviderConfig/ErrorNumSubstringLength control which portion of the filename is used as the error number, and /ErrorProviderConfig/FriendlyFormatString controls how the formatting/dis- play of the node in the monodoc tree. For each file found, it is converted to HTML with C# syntax coloring applied. Simple Documentation Format Converts text files into HTML by translating each newline into an HTML <br> element. Man Page Documentation Format Converts man pages into HTML for display. XHTML Documentation Format Copies the XHTML file as-is. EXAMPLES
To install your documenation for use with monodoc: Create a PREFIX.source file with the contents: <?xml version="1.0"?> <monodoc> <source provider="FORMAT" basefile="PREFIX" path="PATH"/> </monodoc> where FORMAT is the documentation format contained within the PREFIX.tree file, e.g. ecma, or simple. PREFIX is the basename of the .tree and .zip files that mdassembler creates. PATH is the "path" in the monodoc tree that should contain the documentation. See the @prefix@/lib/monodoc/monodoc.xml file for a list of PATH values (the //node/@name values). See also: http://www.mono-project.com/Generating_Documentation Create your documentation See also the monodocer(1) man page, e.g. monodocer -assembly:foo.dll -path:foo/en Assemble the documentation mdassembler --ecma foo/en PREFIX Make sure that you use the same PREFIX here as you did above. Install the documentation by using the command cp PREFIX.source PREFIX.tree PREFIX.zip `pkg-config monodoc --variable=sourcesdir` (Note the backticks used in the pkg-config command!) This copies the .source , .tree , and .zip files into the monodoc sources directory, which will allow monodoc to display the documentation. SEE ALSO
mdcs2ecma(1), mdnormalizer(1), mdoc(1), mdoc-assemble(1), mdvalidator(1), monodocer(1), monodocs2html(1) MAILING LISTS
Visit http://lists.ximian.com/mailman/listinfo/mono-docs-list for details. WEB SITE
See also: http://www.mono-project.com and http://www.mono-project.com/Assembler mdassembler(1)
All times are GMT -4. The time now is 12:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy