Sponsored Content
Top Forums Shell Programming and Scripting AWK script for programatically modifying java files Post 302529476 by panyam on Thursday 9th of June 2011 11:33:32 AM
Old 06-09-2011
Code:
 
 
awk '/public class/ { print;getline;print;getline;print "String var=\"Constant string\";"; }1' input_file > out_file;
 
mv out_file in_file

loop thorugh
Code:
"for file_name in `ls *.java`"

to do the change on all files.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

modifying a awk line

Hi, I want to print specific columns (from 201 to 1001). The line that I am using is listed below. However I also want to print column 1. So column 1 and 201 to 1001. What modifcations do I need to make? Code: awk -F'\t' 'BEGIN {min = 201; max = 1001 }{for (i=min; i<=max; i++) printf... (5 Replies)
Discussion started by: phil_heath
5 Replies

2. Shell Programming and Scripting

Script for adding few methods to bunch of Java files

Hi I have around 1000+ java file under different folder in /home/raxit/source and in each file i want to add a fix method. -------- /* Some comment for few lines like header block etc.. */ package import class A { method1 () { } method2 () (3 Replies)
Discussion started by: raxitsheth
3 Replies

3. Shell Programming and Scripting

Help with modifying files

Hello everyone, I have some data files, with mixed header formats. the sample for the same is: >ABCD76567.x1 AGTCGATCGTAGTCGTAGCTGT >ABCD76567.y1 AGTCGATCGTAGTCGTAGCTGT >ABCD76568.x1 pair_info:898989 AGTCGATCGTAGTCGTAGCTGT >ABCD76568.y1 pair_info:893489 AGTCGATCGTAGTCGTAGCTGT... (2 Replies)
Discussion started by: ad23
2 Replies

4. HP-UX

[Solved] Not able to call a script from another programatically

Hi, I need to call a shell script from another. Let me explain you with an example. a1.sh and b1.sh are two scripts. a1.sh calls b1.sh internally. If i run a1.sh manually, it internally calls b1.sh but the problem is There is a process that calls this a1.sh at regular intervals,... (1 Reply)
Discussion started by: hadarapu
1 Replies

5. UNIX for Dummies Questions & Answers

Understanding / Modifying AWK command

Hey all, So I have an AWK command here awk '{if(FNR==NR) {arr++;next} if($0 in arr) { arr--; if (arr == 0) delete arr;next}{print $0 >"list2output.csv"}} END {for(i in arr){print i >"list1output.csv"}}' list1 list2 (refer to image for a more readable format) This code was submitted... (1 Reply)
Discussion started by: Aussiemick
1 Replies

6. Shell Programming and Scripting

awk script for modifying the file

I have the records in the format one row 0009714494919I MY010727408948010 NNNNNN N PUSAAR727408948010 R007YM08705 9602002 S 111+0360832-0937348 I want to get it int the format 0009714494919I MY010727408948010 NNNNNN N PUSAAR727408948010 R007YM08705 9602002 S ... (2 Replies)
Discussion started by: sonam273
2 Replies

7. Programming

modifying 2 or more values using method in Java

i wanna make modification in two or more identifiers,using a method in JAVA , but the only way to do this is by returning a value ,then also only one variable value can be modified .. one way 2 do do this is by use of array and passing its name in method ,, please suggest a different way of doing... (2 Replies)
Discussion started by: upvan111
2 Replies

8. Shell Programming and Scripting

how to delete certain java script from html files using sed

I am cleaning forum posts to convert them in offline reading version with clean html text. All files are with html extension and reside in one folder. There is some java script i would like to remove, which looks like <script LANGUAGE="JavaScript1.1"> <!-- function mMz() { var mPz = "";... (2 Replies)
Discussion started by: georgi58
2 Replies

9. Shell Programming and Scripting

Modifying Variables in Files

hi list, I am currently looking to develop an installation script which writes out .conf files based on existing .conf files according to variables which are set in a settings file. For example I have a settings file like so: ip=192.168.1.1 hosts=localAnd I want to read a file which... (3 Replies)
Discussion started by: landossa
3 Replies

10. Shell Programming and Scripting

Modifying an awk script for syllable splitting

I have found this syllable splitter in awk. The code is given below. Basically the script cuts words and names into syllables. However it fails when the word contains 2 consonants which constitute a single syllable. An example is given below ashford raphael The output is as under: ... (4 Replies)
Discussion started by: gimley
4 Replies
schemagen(1)						      General Commands Manual						      schemagen(1)

NAME
schemagen - Java(TM) Architecture for XML Binding Schema Generator Specification Version: 2.0 Reference Implementation (RI) Version: 2.0 ea3 Launching schemagen The schema generator can be launched using the appropriate schemagen shell script in the bin directory for your platform. The current schema generator can process either Java source files or class files. We also provide an Ant task to run the schema generator - see the instructions for using schemagen with Ant. For Solaris/Linux % path/to/jaxb/bin/schemagen.sh Foo.java Bar.java ... Note: Writing schema1.xsd For WindowsNT/2000/XP > path ojaxbinschemagen.bat Foo.java Bar.java ... Note: Writing schema1.xsd If your java sources/classes reference other classes, they must be accessable on your system CLASSPATH environment variable, or they need to be given to the tool by using the -classpath/-cp options. Otherwise you will see errors when generating your schema. Command Line Options Usage: schemagen [-options ...] <java files> Options: -d <path> : Specify where to place processor and javac generated class files -cp <path> : Specify where to find user specified files -classpath <path> : Specify where to find user specified files -help : Display this usage message Generated Resource Files The current schema generator simply creates a schema file for each namespace referenced in your Java classes. There is no way to control the name of the generated schema files at this time. For that purpose, use the schema generator ant task. See Also o JAXB 2.0: * Release Notes @ http://java.sun.com/webservices/docs/2.0/jaxb/ReleaseNotes.html * XJC @ http://java.sun.com/webservices/docs/2.0/jaxb/xjc.html * XJCTask @ http://java.sun.com/webservices/docs/2.0/jaxb/xjcTask.html * SchemaGen @ http://java.sun.com/webservices/docs/2.0/jaxb/schemagen.html * schemagenTask @ http://java.sun.com/webservices/docs/2.0/jaxb/schemagenTask.html * Sample Apps @ http://java.sun.com/webservices/docs/2.0/jaxb/samples.html * Changelog @ http://java.sun.com/webservices/docs/2.0/jaxb/changelog2.html o JAXB 1.0.x: * Release Notes @ http://java.sun.com/webservices/docs/2.0/jaxb/jaxb-1_0.html * Changelog @ http://java.sun.com/webservices/docs/2.0/jaxb/changelog.html o JAXB RI Extensions: * Runtime Properties @ http://java.sun.com/webservices/docs/2.0/jaxb/vendorProperties.html * XJC Customizations @ http://java.sun.com/webservices/docs/2.0/jaxb/vendorCustomizations.html * Develop Plugins @ http://java.sun.com/webservices/docs/2.0/jaxb/developPlugins.html o JAXB RI Schema Languages: * W3C XML Schema @ http://java.sun.com/webservices/docs/2.0/jaxb/vendorSchemaLangs.html#xschema * RELAX NG @ http://java.sun.com/webservices/docs/2.0/jaxb/vendorSchemaLangs.html#relaxng * DTD @ http://java.sun.com/webservices/docs/2.0/jaxb/vendorSchemaLangs.html#dtd o JAXB Community: * Java.net Homepage @ http://jaxb.dev.java.net * Developer interest list @ https://jaxb.dev.java.net/servlets/ProjectMailingListList * FAQ @ https://jaxb.dev.java.net/faq/index.html 07 Aug 2006 schemagen(1)
All times are GMT -4. The time now is 05:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy