Reading flatfile line by line using smooks

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Reading flatfile line by line using smooks

Smooks User
Hi All,

I am new to Smooks. I have a requirement to pass flat file from input and read it line by line using smooks. Can anyone suggest how this can be achieved. I would appreciate if you have any code sample.

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Reading flatfile line by line using smooks

jamad@yorku.ca
You are lucky. There are a lot of examples like: cvs-to-java



best regards,

jama



-----Sri <[hidden email]> wrote: -----
To: [hidden email]
From: Sri <[hidden email]>
Date: 12/18/2014 02:05PM
Subject: [milyn-dev] Reading flatfile line by line using smooks

Hi All,

I am new to Smooks. I have a requirement to pass flat file from input and
read it line by line using smooks. Can anyone suggest how this can be
achieved. I would appreciate if you have any code sample.

Thanks



--
View this message in context: http://milyn.996300.n3.nabble.com/Reading-flatfile-line-by-line-using-smooks-tp8958.html
Sent from the milyn - dev mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

     http://xircles.codehaus.org/manage_email


--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|

Re: Reading flatfile line by line using smooks

Smooks User
Thanks jama. But I am looking for a flatfile input with variable length records in it.
Reply | Threaded
Open this post in threaded view
|

Re: Reading flatfile line by line using smooks

Tom Fennelly
I assume you are talking about a CSV based format in that case? The
records need to be delimited in some way. If they are not fixed width,
then it must be character based. If it's some other "fuzzy" algorithm
for delimiting then you may need to implement a custom reader, or maybe
the regex reader might work.

On 18/12/2014 20:31, Smooks User wrote:

> Thanks jama. But I am looking for a flatfile input with variable length
> records in it.
>
>
>
> --
> View this message in context: http://milyn.996300.n3.nabble.com/Reading-flatfile-line-by-line-using-smooks-tp8958p8961.html
> Sent from the milyn - dev mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>      http://xircles.codehaus.org/manage_email
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Reading flatfile line by line using smooks

Smooks User
Hi,

Basically I do not need to delimit the records in each line. What I need is to read the input flatfile and spit each line as output. So I need to delimit by "\n" (new line) in the input flatfile. May I know how it can be done. Sample smooks-config file and Java code is appreciated.

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Reading flatfile line by line using smooks

Tom Fennelly
It seems like using Smooks for this is overkill. Is there some reason
you can't simply use a BufferedReader ?

On 22/12/2014 15:56, Smooks User wrote:

> Hi,
>
> Basically I do not need to delimit the records in each line. What I need is
> to read the input flatfile and spit each line as output. So I need to
> delimit by "\n" (new line) in the input flatfile. May I know how it can be
> done. Sample smooks-config file and Java code is appreciated.
>
> Thanks
>
>
>
> --
> View this message in context: http://milyn.996300.n3.nabble.com/Reading-flatfile-line-by-line-using-smooks-tp8958p8964.html
> Sent from the milyn - dev mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>      http://xircles.codehaus.org/manage_email
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Reading flatfile line by line using smooks

Smooks User
Hi,

Currently we are using smooks in the project to handle XML. Now we need to support flatfile format, so trying to build a solution around smooks.

Thanks,