OMBPlus - TCL - reading variables out of text file
Hello,
i want to read out variables from a text file.
For example to connect
OMBCONNECT $login/$pass@$host:1522:$service
and those 4 variables are in a text file.
i'm a newbie, so it could be a stupid question
thanks!
I should point out that, if you are just using this for variable config then there is a far easier way to do this. Put the assignments in a separate .tcl file and then simply use the "source" command to read it. This becomes very handy as you start to build a library of functions that you will want to re-use across multiple scripts. Think of the command "source" to mean "copy that file and paste it into this one right here"
For example, I have a config file and a library file.
The config file might look like:
#file config.tcl
# GLOBAL VARIABLE DECLARATION SECTION
#CORPORATE DESIGN REPOSITORY CONNECTION INFORMATION
# Login info for the design repository owner
set OWB_DEG_USER michael
set OWB_DEG_PASS mypassword
set OWB_DEG_HOST ourhost.company.net
set OWB_DEG_PORT 1611
set OWB_DEG_SRVC orcl And a library file of functions called omb_library.tcl
Now, in all my scripts it starts with:
# File Some_Script.tcl
# Get Current Script name (excluding file extension), Directory and time
set dtstmp [ clock format [clock seconds] -format {%Y%m%d_%H%M}]
set scrpt [ file split [file root [info script]]]
set scriptDir [ file dirname [info script]]
set scriptName [ lindex $scrpt [expr [llength $scrpt]-1]]
# Library and config file are in same directory as the script
set cnfg_lib "$scriptDir/config.tcl"
set owb_lib "$scriptDir/omb_library.tcl"
# Import Library and config file
#get config file
source $cnfg_lib
#get standard library
source $owb_lib
# Create a subdirectory under the runnign directory, and create a log-file
# in that directory based on the script name and timestamp
set LOG_PATH "$scriptDir/logs"
file mkdir $LOG_PATH
set SPOOLFILE ""
append SPOOLFILE $LOG_PATH "/log_" $scriptName "_" $dtstmp ".txt"With this block I eliminate the need to hardcode directories. As long as my config and library files are located with the script I can deploy them anywhere and they will get read and used.
Cheers,
Mike
Edited by: zeppo on Mar 10, 2010 7:40 AM
Similar Messages
-
Reading variables from a text file into a flash projector exe
I am using Flash CS4 and my script is in ActionScript2.
I am developing a flash projector file that runs when a user puts in a cd to guide them through the steps they need to install a program and then kicks off the installer.
I use fscommand to run a utility that reads the users registry to determine the PCs regional settings and then writes this to a text file in the users %temp% directory.
I then use the LoadVariablesNum command to read in the text file and get the variables.
This was working fine when I had the text file stored in a different directory, but when I try and refer to the %temp% directory, I get an Error opening file message.
Is there anyway to get flash to look in the %Temp% directory?
Thanks in advance,
Carol LutzCode-tags sometimes cause wonders, I replaced # with *, as the code tags interprets # as comment, which looks odd:
******...*.........To your code: Did you test it step by step, to find out about what is read? You could either use a debugger (e.g., if you have an IDE) or system outs to get a clue. First thing to check would be, if the maze size is read correctly. Further, the following loops look odd:for(int i = 0; i < maze.length; i++) {
for(int x = 0; x < maze.length; x++) {
if (input.hasNextLine()) {
String insert = input.nextLine();
maze[x] = insert.charAt(x);
}Shouldn't the nextLine test and assignment be in the outer loop? And assignment be to each maze's inner array? Like so:for(int i = 0; i < maze.length; i++) {
if (input.hasNextLine()) {
String insert = input.nextLine();
for(int x = 0; x < insert.size(); x++) {
maze[i][x] = insert.charAt(x);
}Otherwise, only one character per line is read and storing a character actually should fail. -
At end of tether! Reading in variables from a text file
Hi all
My stress factor has gone through the roof because I am trying to read in from a text file (you may have seen some earlir questions about ArrayLists) it's just not working!
The code is below. The result is that it's reading in all of the car data, none of the motorbike and only the first line for the services. It's odd and it's driving me insane!
Here's an example of the data it's reading. There are about 7-10 sets of data per type
<car><reg>AB04CDE</reg><make>Ford</make><model>Fiesta</model><colour>blue</colour><passenger_no>4</passenger_no></car>
<service><service_no>13570</service_no><reg>J605PLE</reg><date>15:07:2006</date><miles>20000</miles><part_replaced>brake_pads</part_replaced><part_replaced>front_tyres</part_replaced></service>
<motorbike><reg>TT05EKJ</reg><make>Triumph</make><model>Speedmaster</model><colour>black</colour><load>20.50</load></motorbike>
Here's the code
while (moreToRead) {
String line;
try {
line = fileReader.getNextStructure();
// collect the data from the file
if (line.indexOf("<car>")> -1){
// Select/Extract the registration element
int nStart = line.indexOf("<reg>");
int nEnd = line.indexOf("</reg>");
String reg = line.substring(nStart+5,nEnd);
// Select/Extract the make element
nStart = line.indexOf("<make>");
nEnd = line.indexOf("</make>");
String make = line.substring(nStart+6,nEnd);
// Select/Extract the model element
nStart = line.indexOf("<model>");
nEnd = line.indexOf("</model>");
String model = line.substring(nStart+7,nEnd);
// Select/Extract the colour element
nStart = line.indexOf("<colour>");
nEnd = line.indexOf("</colour>");
String colour = line.substring(nStart+8,nEnd);
// Select/Extract the passenger_no element
nStart = line.indexOf("<passenger_no>");
nEnd = line.indexOf("</passenger_no>");
String passenger_no = line.substring(nStart+14,nEnd);
//convert string to int
int passengerInt = Integer.parseInt(passenger_no);
// declare new object car and assign the variables then add it to the array.
Car c = new Car (reg, make, model, colour, passengerInt);
carList.add(c);
} else if (line.indexOf("<bike>")> -1) {
// Select/Extract the registration element
int nStart = line.indexOf("<reg>");
int nEnd = line.indexOf("</reg>");
String reg = line.substring(nStart+5,nEnd);
// Select/Extract the make element
nStart = line.indexOf("<make>");
nEnd = line.indexOf("</make>");
String make = line.substring(nStart+6,nEnd);
// Select/Extract the model element
nStart = line.indexOf("<model>");
nEnd = line.indexOf("</model>");
String model = line.substring(nStart+7,nEnd);
// Select/Extract the colour element
nStart = line.indexOf("<colour>");
nEnd = line.indexOf("</colour>");
String colour = line.substring(nStart+8,nEnd);
// Select/Extract the load element
nStart = line.indexOf("<load>");
nEnd = line.indexOf("</load>");
String load = line.substring(nStart+6,nEnd);
//convert load string to double
double bikeLoad = Double.parseDouble(load);
// declare new object motorbike and assign the variables then add it to the array.
Motorbike m = new Motorbike (reg, make, model, colour, bikeLoad);
bikeList.add(m);
} else {
// Select/Extract the service_number element
int nStart = line.indexOf("<service_no>");
int nEnd = line.indexOf("</service_no>");
String service_no = line.substring(nStart+12,nEnd);
console.println("service = " + service_no);
nStart = line.indexOf("<reg>");
nEnd = line.indexOf("</reg>");
String reg = line.substring(nStart+5,nEnd);
console.println("service = " + reg);
nStart = line.indexOf("<date>");
nEnd = line.indexOf("</date>");
String date = line.substring(nStart+6,nEnd);
console.println("service = " + date);
nStart = line.indexOf("<miles>");
nEnd = line.indexOf("</miles>");
String miles = line.substring(nStart+7,nEnd);
console.println("service = " + miles);
nStart = line.indexOf("<part_replaced>");
nEnd = line.indexOf("</part_replaced>");
String part_replaced = line.substring(nStart+15,nEnd);
console.println("service = " + part_replaced);
//convert string to int
int dateOfService = Integer.parseInt(date);
//convert string to double
double milesAtService = Double.parseDouble(miles);
//convert service no to unique int
int serviceNo = Integer.parseInt(service_no);
// declare new object service and assign the variables then add it to the array.
Service s = new Service (reg, part_replaced, serviceNo, dateOfService, milesAtService);
serviceList.add(s);
catch (Exception e) {
// Run out of data
moreToRead = false;
} If anyone can spy anything that could be causing this I love your advice. I simply can't see it.
Johi jos,
we have been asked not to use a parser for this assignment. evil
tutor i think! lolYour example seems to imply that all the <tag> ... </tag> pairs have
to occur on a single line; if that is so, you can do some cheap
programming like this:String getText(String line, String tag) {
int start= line.indexOf("<"+tag+">");
int end= line.indexOf("</"+tag+">", start);
if (start < 0 || end < 0) return null; // no <tag> ... </tag> pair found
// return the text in between the <tag> ... </tag> tags
return line.substring(start+tag.length()+2, end);
}kind regards,
Jos -
How to define and populate value to a variable in a text file
hi all,
i have a text file on unix server, when i read it through open dataset, is it possible to populate dynamic value to a variable in the text file. and is it possible to define a variable at any place in the text file?
after this the program will send the internal table for emailing.
thanks.Hi, If this file on server is a email template you can put some tags / marks and you can change it after you read it with OPEN DATASET / READ...
Sample:
OPEN DATASET p_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
CHECK sy-subrc EQ 0.
DO.
READ DATASET p_file INTO lv_string.
IF sy-subrc EQ 0.
EXIT.
ENDIF.
REPLACE ALL OCCURENCES OF '((SYSTEM_ID))' WITH sy-sysid.
APPEND input_file_tab.
ENDDO.
CLOSE DATASET p_file.
on file there's a line with:
This email was generated on server ((SYSTEM_ID))
It will be translated to (sy-sysid = DEV):
This email was generated on server DEV
This is a "variable" like that you can use. -
Need to read data from a text file
I need to read data from a text file and create my own hash table out of it. I'm not allowed to use the built in Java class, so how would I go implementing my own reading method and hash table class?
It's not possible to read from a file without using classes from the core API*. You'll have to get clarification from your instructor as to which classes are and are not allowed.
[http://java.sun.com/docs/books/tutorial/essential/io/]
*Unless you write a bunch of JNI code to replicate what the java.io classes are doing. -
how can i read a large size text file in multiple parts without lossin any data ?
BenWhy are you afraid of losing data? There's no reason that you would lose data if you are reading a large text file.
You should use the various Reader and Writer classes in package java.io to read and write text files. Here's an example of how you can read a text file line by line:
BufferedReader r = new BufferedReader(new FileReader("myfile.txt));
int lineno = 1;
String line;
while ((line = r.readLine()) != null) {
System.out.printf("%d: %s%n", i, line);
i++;
r.close(); -
Read data from a text file, one line at a time.
I need to read data from a text file, and display each line in a String Indicator on Front Panel. It displays each line, but I get Error 4, End Of Line, unless I enter an extra line of data in the file that I don't need. I tried Read From Text File.vi, made by Nat Instr, and it gave the same error.
The Read from Text File.vi reads data from a text file line by line until the user stops the VI manually with the Stop button on the front panel, or until an error (such as "Error 4, End of file") occurs. If an error occurs, the Simple Error Handler.vi pops up a dialog that tells you which error occurred.
The Read from Text File.vi uses a while loop, but if you knew how many lines you wanted to read, you could replace the while loop with a for loop set to read that many lines from the file.
If you need something more dynamic because the number of lines in your files vary, then you could change the code of the Read from Text File.vi to the expect "Error 4, End of file" and handle it appropriately. This would require unbundling the error cluster that comes fro
m the Read File function with the Unbundle By Name function, so that you can expose the individual error "status" and error "code" values stored in the cluster. If the value of the error "code" is 4, then you can change the error "status" from true to false, and you can rebundle the cluster with the Bundle by Name function. Setting the error "status" to false instructs the Simple Error Handler to ignore the error. Otherwise, pass the original error cluster to the Simple Error Handler.vi, so that you can see what the error is.
Of course, if you're not interested in what the errors are, you could just remove the Simple Error Handler.vi, but then you wouldn't see any error messages.
Best of Luck,
Dieter
Dieter Schweiss
Applications Engineer
National Instruments -
Shell scripts to read data from a text file and to load it into a table
Hi All,
I have a text file consisting of rows and columns as follows,
GEF001 000093625 MKL002510 000001 000000 000000 000000 000000 000000 000001
GEF001 000093625 MKL003604 000001 000000 000000 000000 000000 000000 000001
GEF001 000093625 MKL005675 000001 000000 000000 000000 000000 000000 000001 My requirement is that, i should read the first 3 columns of this file using a shell script and then i have to insert the data into a table consisting of 3 rows in oracle .
the whole application is deployed in unix and that text file comes from mainframe. am working in the unix side of the application and i cant access the data directly from the mainframe. so am required to write a script which reads the data from text file which is placed in certain location and i have to load it to oracle database.
so I can't use SQL * loader.
Please help me something with this...
Thanks in advance.1. Create a dictionary object in Oracle and assign it to the folder where your file resides
2. Write a little procedure which opens the file in the newly created directory object using ULT_FILE and inside the FOR LOOP and do INSERTs to table you want
3. Create a shell script and call that procedure
You can use the post in my Blog for such issues
[Using Oracle UTL_FILE, UTL_SMTP packages and Linux Shell Scripting and Cron utility together|http://kamranagayev.wordpress.com/2009/02/23/using-oracle-utl_file-utl_smtp-packages-and-linux-shell-scripting-and-cron-utility-together-2/]
Kamran Agayev A. (10g OCP)
http://kamranagayev.wordpress.com -
Reading parameters in a text file
Hi all,
i'm trying to read a text file and get some parameters delimited by =
i tried a lot to find some topic that was already sent in the forum but without any success.
my text file look like that
// configuration file
user=internal
pass=oracle
i want to put the values "internal" and "oracle" in a variable strings.
even that i tried to use tokens it did not work as well. I would appreciate if someone could send to me any code example showing how to do that because i spent all my java knowlegde with that.
tks in advance
Fabio - BrazilHere's an example of using java.util.Properties. You'll need to create a text file with the extension, "properties" (i.e. name.properties or cars.properties), and place the file in your classpath. If you don't place it in the classpath, then the file won't be found. Within that file, you'll need to use the format:
key=valuewith each line being a new property. For example:
# Comments....
# file name: names.properties
# property 1
firstname=Jerry
# property 2
lastname=SeinfeldThat's it for defining your properties. To use the properties, you'd use it in the following manner:
import java.util.ResourceBundle;
import java.util.MissingResourceException;
public class TestProp {
public static void main(String args[]) {
// ResourceBundle will search for the file "names.properties"
// in the classpath. If it doesn't exist, then it throws
// MissingResourceException. Please note that although the file
// name is, "names.properties", we only need to specify, "names"
// in the, getBundle method.
try {
// don't specify the properties extension
ResourceBundle bundle = ResourceBundle.getBundle("names");
System.out.println("Properties retrieved from bundle");
System.out.println("first name:" + bundle.getString("firstname"));
System.out.println("last name: " + bundle.getString("lastname"));
} catch( MissingResourceException ex ) {
System.out.println(ex);
}The output of the above code would be:
java -cp . TestProp
Properties retrieved from bundle
first name: Jerry
last name: SeinfeldHope this helps. -
Reading characters from a text file into a multidimensional array?
I have an array, maze[][] that is to be filled with characters from a text file. I've got most of the program worked out (i think) but can't test it because I am reading my file incorrectly. However, I'm running into major headaches with this part of the program.
The text file looks like this: (It is meant to be a maze, 19 is the size of the maze(assumed to be square). is free space, # is block, s is start, x is finish)
This didn't paste evenly, but thats not a big deal. Just giving an idea.
19
5..................
And my constructor looks like follows, I've tried zillions of things with the input.hasNext() and hasNextLine() to no avail.
Code:
//Scanner to read file
Scanner input = null;
try{
input = new Scanner(fileName);
}catch(RuntimeException e) {
System.err.println("Couldn't find the file");
System.exit(0);
//Set the size of the maze
while(input.hasNextInt())
size = input.nextInt();
//Set Limits on coordinates
Coordinates.setLimits(size);
//Set the maze[][] array equal to this size
maze = new char[size][size];
//Fill the Array with maze values
for(int i = 0; i < maze.length; i++)
for(int x = 0; x < maze.length; x++)
if(input.hasNextLine())
String insert = input.nextLine();
maze[i][x] = insert.charAt(x);
Any advice would be loved =DCode-tags sometimes cause wonders, I replaced # with *, as the code tags interprets # as comment, which looks odd:
******...*.........To your code: Did you test it step by step, to find out about what is read? You could either use a debugger (e.g., if you have an IDE) or system outs to get a clue. First thing to check would be, if the maze size is read correctly. Further, the following loops look odd:for(int i = 0; i < maze.length; i++) {
for(int x = 0; x < maze.length; x++) {
if (input.hasNextLine()) {
String insert = input.nextLine();
maze[x] = insert.charAt(x);
}Shouldn't the nextLine test and assignment be in the outer loop? And assignment be to each maze's inner array? Like so:for(int i = 0; i < maze.length; i++) {
if (input.hasNextLine()) {
String insert = input.nextLine();
for(int x = 0; x < insert.size(); x++) {
maze[i][x] = insert.charAt(x);
}Otherwise, only one character per line is read and storing a character actually should fail. -
I'm attempting to write a Combat Converter for a popular online game called Ogame. I'm attempting to read a text file that contians something similiar to the sample of the text file I have provided below. What I want to take out from the file is the first and last time a line that begins with Type and Num that shows up for the attacker and defender. However I'm having trouble figuring out how write it so that it does not take it out for the rest of the lines that start with Type and Num. Do you have any suggestions on how I should go about do so?
Attacker 1
Weapons:+10% Shields:+10% Armour:+10%
Type S.Cargo L.Cargo L.Fighter H.Fighter Cruiser B.Ship Col. Ship Recy. Esp. Probe Bomber Dest. Rip Battlecr
Num 1 1 1 1 1 1 1 1 1 1 1 1 1
Weapon 5 5 55 165 440 1.100 55 1 0 1.100 2.200 220.000 770
Shields 11 27 11 27 55 220 110 11 0 550 550 55.000 440
Armour 440 1.320 440 1.100 2.970 6.600 3.300 1.760 110 8.250 12.100 990.000 7.700
Defender 1
Weapons:+10% Shields:+10% Armour:+10%
Type S.Cargo L.Cargo L.Fighter H.Fighter Cruiser B.Ship Col. Ship Recy. Esp. Probe Bomber Sol. Sat Dest. Rip Battlecr Miss. L.Laser H.Laser Gauss Ion.C Plasma S.Dome LS.Dome
Num 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Weapon 5 5 55 165 440 1.100 55 1 0 1.100 1 2.200 220.000 770 88 110 275 1.210 165 3.300 1 1
Shields 11 27 11 27 55 220 110 11 0 550 1 550 55.000 440 22 27 110 220 550 330 2.200 11.000
Armour 440 1.320 440 1.100 2.970 6.600 3.300 1.760 110 8.250 220 12.100 990.000 7.700 220 220 880 3.850 880 11.000 2.200 11.000
The attacking fleet fires a total of 18 times with the total power of 1.059.543 upon the defender.
The defender's shields absorb 18.910 damage points.
The defending fleet fires a total of 33 times with the total power of 1.922.677 upon the attacker.
The attacker's shields absorb 38.730 damage points.
Attacker 1
Type B.Ship Col. Ship Rip
Num 0 0 1
Weapon 1.100 55 220.000
Shields 220 110 55.000
Armour 6.600 3.300 990.000
Defender 1
Type S.Cargo L.Cargo L.Fighter H.Fighter Cruiser B.Ship Col. Ship Esp. Probe Bomber Dest. Rip Battlecr Miss. L.Laser Ion.C S.Dome LS.Dome
Num 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0
Weapon 5 5 55 165 440 1.100 55 0 1.100 2.200 220.000 770 88 110 165 1 1
Shields 11 27 11 27 55 220 110 0 550 550 55.000 440 22 27 550 2.200 11.000
Armour 440 1.320 440 1.100 2.970 6.600 3.300 110 8.250 12.100 990.000 7.700 220 220 880 2.200 11.000
The attacking fleet fires a total of 11 times with the total power of 2.276.933 upon the defender.
The defender's shields absorb 17.510 damage points.
The defending fleet fires a total of 47 times with the total power of 9.540.458 upon the attacker.
The attacker's shields absorb 15.761 damage points.
Attacker 1
Type Rip
Num 0
Weapon 220.000
Shields 55.000
Armour 990.000
Defender 1
Type S.Cargo B.Ship Esp. Probe Bomber Dest. Rip Battlecr S.Dome LS.Dome
Num 0 0 0 0 0 0 0 0 0
Weapon 5 1.100 0 1.100 2.200 220.000 770 1 1
Shields 11 220 0 550 550 55.000 440 2.200 11.000
Armour 440 6.600 110 8.250 12.100 990.000 7.700 2.200 11.000
The battle ends draw.
The attacker has lost a total of 10.178.000 units.
The defender has lost a total of 1.836.800 units.
At these space coordinates now float 1.776.210 Metal and 1.413.954 Crystal.I'm attempting to write a Combat Converter for a
popular online game called Ogame. I'm attempting to
read a text file that contians something similiar to
the sample of the text file I have provided below.
What I want to take out from the file is the first
and last time a line that begins with Type and Num
that shows up for the attacker and defender....Please define "take out from the file". Do you want to read and store just these lines?
Or do you want to remove these lines from the file and rewrite the file without these lines?
/Pete -
Reading Data From A Text File via AppleScript
Here is my question. I have a text file I need to read data from....this is what the text file looks like opened in text editor:
"SLUG
, 06/16/06, APPLE COMPUTER INC , 69x8.50, jondnotin
now what I need to do is get the 69 and the 8.50 as seperate variables...now every file that is going to be read is setup the same with different information but the data type is the same and in the same order. So what syntax do I need to read this file and set thoes two numbers to variables? Thanks!
PowerMac G5, iBook G4, Intel MacMini, PowerMac G3 B&W, iMac DV Blueberry Mac OS X (10.4.7)Hello
You where right for the file structure.
I think that it is a complementary reason to locate the data whithout assuming that it sit in paragraph x or y.
The trailing script get rid of that and allow to grab values from a file containing more than a single entry.
--[SCRIPT]
set leChemin to "Macintosh HD:Users:yvankoenig:Desktop:_testfile.txt"
set {val1, val2} to my decipher(read file leChemin, "APPLE COMPUTER INC , ")
display dialog "" & val1 & return & val2
-- -+-+-+-+-+-+-+-
on decipher(t, d)
set {oTID, AppleScript's text item delimiters, texte} to {AppleScript's text item delimiters, d, t}
set {texte, AppleScript's text item delimiters} to {text item 2 of texte, ","}
set {texte, AppleScript's text item delimiters} to {text item 1 of texte, "x"}
set {v1, v2, AppleScript's text item delimiters} to {text item 1 of texte, text item 2 of texte, oTID}
return {v1, v2}
end decipher
-- -+-+-+-+-+-+-+-
--[/SCRIPT]
Yvan KOENIG (from FRANCE vendredi 8 septembre 2006 20:38:46) -
Reading data from a text file but can't use the data outside of the function.
I am trying to load a variable from data in a text file.
I can read the text file fine but the variable data seems
only to be available with in the function that reads it.
I need to use the variable data outside of the function.
Does anyone have any suggestions to work around this issue?
This is the actionscript code i'm using.
var pathVars= new LoadVars();
pathVars.onLoad=function(ok) {
if(ok)
trace("Loading");
path_var=pathVars.path;
trace("This is within the function "+path_var);
pathVar0="This is within the function... "+path_var;
Yet the path_var is available here fine.
pathVars.load("mypath.txt");
This is where the path_var becomes undefined
trace("This is outside the function... "+path_var);
pathVar1="This is outside the function... "+path_var;
This
is a download link for the FLA zip file
This
is a demo of the script loading the text fileThe external traces are being executed before the file is
loaded. -
Reading data from a text file into PAS - Dimension member names truncated
Hi,
I created a procedure to dump variables and data into a text file to load into another model. I used a semicolon as a field seperator.
The data, measures and dimension members are dumped properly into a text file and no dimension member names are truncated .
However when I read the data into a measure, and I issue a peek command, dimension meber names are read in truncated
and remain full names in the text file. Any reason for this? What do I need to do to prevent this from happening?
THanks.
LungileHi Lungile,
The problem that you're likely having is that you haven't created a file description for the file from which you're reading. When loading data into Application Server from a text file, you would normally go through three steps:
1. Enter the ACCESS EXTERNAL subsystem
2. Specify the name of the file to be read
3. Specify the format of the file field names, types, widths, and positions.
If you go into the Application Server help, select "Application Server Help", then "Application Server at the command level", then "Variables and reading in data", and then "Reading an external file", you will have the process of the steps you need to follow outlined for you, including links to the help topic for each command you need to issue.
So what I think you need to do is use the DESCRIPTION command to specify the names of your fields, their type, and also their width, in order to ensure no truncation of data on the load.
The same DESCRIPTION statement is required if you want to use your text file as the source of a dimension.
Hope this helps,
Robert -
Problem in reading data of a text file
Hi
Is there any method for reading a particular word which is there in the middle of the line from a text file.
Thanks,
KiranYou can do it like this may be it will work for you....
String str=null;
DataInputStream di=new DataInputStream(new FileInputStream("D:\\Test.txt"));
while((str=di.readLine())!=null)
if(str.contains("Time"))
int index=str.indexOf("Time");
str=str.substring(index,str.length());
System.out.println(str);
}
Maybe you are looking for
-
Adobe Media Encoder cs5 - No audio
I am using Adobe Media Encoder cs5 version 5.0.1.0 on a Windows XP Service Pack 3 32-bit machine. None of the wmv or avi files I try to encode have the audio track encoded. I have tried encoding with both the "F4V - Match Source Attributes" and "FL
-
Reg:Tax code validity period
Hi All For the condition type jmop for the key combination tax code i'm not getting the validity period I have checked the 1. condition type jmop (val dt from & Val dt To) 2.access secequence In Fv11 i'm not getting it Plz guide me
-
Two wireless laptops - File transfer Q
I have a G3 iBook with an original Airport card, a Powerbook with an Airport Extreme card, and they both connect to an Airport Extreme Base Station in my house. My question is, when I want to transfer files from the iBook to the Powerbook what's the
-
Need suggestions in doing my Init and Deltas
Hello Experts, I am using the standard SALES OVERVIEW cube to store the sales data. I have introduced the custom built ODS to store the order level data in my flows. I am about to test my flows but I am afraid if the custom built ODS in the flows wil
-
Delivery is to be done at the end user location not at the storage location
Hai Gurus. I have a problem I am working for a construction industry.. I had a storage location at say" X":. And in case of emergency for the material to the end user at different locations, delivery is to be done at the end user location not at t