Importing/exporting data with carriage returns (I Think)
Mike Fedkiw
mfedkiwfp at gmail.com
Sat Aug 26 11:36:05 PDT 2017
I own a pet supply company and years ago needed something to run it,
like in the 80's I think. That's when I found someone to write a little
invoicing program in filepro which we used that and of course had the
guy add a few little things over time. About six years ago(I can't even
remember) I decided to try and update everything so I started re-writing
everything myself starting from scratch. It didn't seem that difficult
to do(at least most of it) but It was no small undertaking to write
everything from invoicing, shipping & receiving, A/R, invy, label
printing, barcode stuff, etc, etc... I think I actually did a decent job
of it but of course there's learning when I come to something that I
haven't really done before, (importing/exporting) for example.
Probably unlike a lot of other people writing code, I have absolutely
ZERO schooling for anything that has to do with computers or writing
programs, I run a pet supply company.
I appreciate all the help I've been able to get from people replying to
my posts on here. Please understand though, I only write a few things in
filepro for my own company. So making statements like this
Just pretend I never said anything which might actually help you, that
all you will ever have or use are tools to which you've already been
exposed, and that you don't need to do any research of moderate depth on
your own in order to solve -your- problems.
I don't think is very fair and certainly not helpful in any way. If I
have no clue what all this Linux, perl, tr, sed, \001, \007 are why not
try and help me out, I thought that was what this was for???
I've spent the last couple of weeks working on trying to figure out how
to import the data into the memo's and then get it exported. When
someone replies with something that I may not understand to me it only
makes sense to reply back inquiring as to what they may be saying.
Regardless Mark, you have helped me with things in the past and that is
appreciated. I don't know why you would write a reply like that just
because I may not understand what you're saying. I can't see the benefit
of sitting here and trying to search on the web to try and decipher what
you might have said instead of simply just replying and asking you.
Anyway, like I said in my initial post, I'd much rather be paying
someone to write the processes I need to do this. If someone is
interested please email me at mikefedkiw at aol.com.
Mike
On 8/26/2017 1:46 PM, Fairlight via Filepro-list wrote:
> Just pretend I never said anything which might actually help you, that all
> you will ever have or use are tools to which you've already been exposed,
> and that you don't need to do any research of moderate depth on your own in
> order to solve -your- problems.
>
> It's all good.
>
> Have a pleasant weekend.
>
> m->
>
> On Sat, Aug 26, 2017 at 01:38:16PM -0400, Mike Fedkiw thus spoke:
>> I'm kinda getting lost in some of the comments to my post. For
>> instance... "tr or sed", had to google that to see that it had
>> something to do with Linux(I'm on WinServer2008r2). I'm usually fairly
>> good at figuring things out but I've also never seen or used anything
>> involving perl so I don't even know what a perl port is referencing.
>> When you talk about changing the carriage returns to other things like
>> \001 or \007 (bell), whet characters are those, I don't see anything
>> like that in the Filepro character table.
>> BTW, do you know what the memo would look like if I imported this data
>> without the carriage returns, will it still have spacing between the
>> paragraphs?
>> "A lack of electrolytes in aquarium freshwater may cause serious health
>> problems for freshwater fish. API AQUARIUM SALT supplies electrolytes
>> to improve fish respiration. Made from evaporated sea water and
>> containing natural active ingredients such as a natural fish tonic, API
>> AQUARIUM SALT promotes the overall health of your fish by improving
>> their gill function and reducing stress in a freshwater aquarium. This
>> all-natural salt provides the essential electrolytes fish need for the
>> uptake of oxygen and release of carbon dioxide and ammonia through the
>> gills. API AQUARIUM SALT should only be added to reduce stress during
>> new freshwater aquarium setup and water changes or to promote disease
>> recovery when solving specific fish health issues. Use API AQUARIUM
>> SALT when setting up a new freshwater aquarium, when changing water or
>> treating disease. Make sure to take extra care when using salt with
>> live plants, as some plants may be sensitive.
>> With API Aquarium products, it?s easy to keep a beautiful saltwater,
>> freshwater or reef aquarium. For over 50 years, API has been creating
>> innovative, research-driven solutions that make it easier to care for
>> your fish and aquarium. API Aquarium Treatment Supplies are designed to
>> work in conjunction with each other to provide best results to control
>> algae, promote healthy bacterial growth and help control and cure fish
>> diseases and conditions such as ich and fin rot. They work to provide a
>> safe, hospitable environment for fish such as tropical community fish,
>> cichlids, goldfish and more. With API, you can spend more time admiring
>> your fish, and less time scrubbing your tank. Make sure to use all
>> products as directed in order to ensure the best results."
>> Mike
>>
>> On 8/26/2017 2:28 AM, Fairlight via Filepro-list wrote:
>>
>> You'd use an external program like tr or sed to replace carriage returns
>> (\r) with pretty much any character you know won't interfere with the data.
>> \001 is almost certain to never be in data. Using \007 (bell) would work
>> just as well.
>>
>> Perl can easily do this as well, and I know exactly where to get Perl ports
>> for Windows, if you're on that.
>>
>> mark->
>>
>> On Sat, Aug 26, 2017 at 12:47:47AM -0400, Mike Fedkiw thus spoke:
>>
>> Can you explain what you mean with the \001 and the the \r? I'd assume
>> maybe the \r is a carriage return but I haven't a clue what \001 could
>> be. And how would I go about translating them?
>>
>> Mike
>>
>> On 8/25/2017 4:29 PM, Fairlight via Filepro-list wrote:
>>
>> Why not just translate the \r to \001 before import, and then whenever
>> outputting or otherwise referencing the data on the way out, translate \001
>> to \r?
>>
>> m->
>>
>> On Fri, Aug 25, 2017 at 02:54:31PM -0500, Richard D. Williams via Filepro-list t
>> hus spoke:
>>
>> Top Post
>>
>> Mike,
>>
>> You have a real problem here. Typically we need some unique
>> character to indicate the end of a row.
>> That usually is a carriage return. If you have carriage returns
>> inside any column in the spreadsheet and you use
>> filepro's import, that would be understood to be the end of the row.
>>
>> I do not know any way you can read this into a file the normal way.
>>
>> But, if you are willing to do some manual manipulation, there is a solution.
>>
>> Working on the assumption there is a column with some unique
>> identifier for that row why not;
>>
>> 1) make a copy of the original.
>> 2) working on the copy, remove the column that contain the carriage return.
>> 3) save as a csv file
>> 4) import the remain columns into your file using the file import commands
>> 5) make another copy of the spreadsheet
>> 6) remove all columns except the column containing the key
>> identifier for that row and the one containing the carriage returns.
>> 7) add a column to the end and place a ~ in that column for each row
>> 8) save as a csv file
>> 9) now import this spreadsheet using the file import command and set r=~
>> 10) use the key identifier column to place the text into the memo
>> field for each record.
>>
>> Hope this helps,
>>
>> Richard D. Williams
>>
>> On 8/25/2017 2:10 PM, Mike Fedkiw via Filepro-list wrote:
>>
>> Okay, so if I remove the carriage returns before importing the
>> data using xlate I'm assuming it would all just wind up as a
>> continuous line of data. If that's right, is there any way of
>> importing the data retaining the spacing between the data so it'll
>> be there when exported. Although I've already had issues with the
>> data not exporting after the first carriage return last time I
>> tried it.
>>
>> Mike
>>
>>
>> On 8/25/2017 1:58 PM, Chris Rendall via Filepro-list wrote:
>>
>>
>> You can use the XLATE command to remove the carriage return in a
>> CSV import.
>>
>> When I use the import command I set the name to "rec": import
>> ascii rec=/home/chris/list.csv r=\n f=,
>>
>> Then to remove the carriage return I use: rc=xlate(rec(14),chr("13"),"")
>>
>> The number 14 inside rec(14) is the number of the field you are
>> importing. If every field has a carriage return in them you
>> will need to use xlate for every field, rec(1), rec(2), and so
>> on for the number of fields you are importing per record. On
>> Linux when I'm importing a CSV file from Windows I just need to
>> run the xlate command on the last field I'm importing.
>>
>> -- Chris
>>
>> -----Original Message-----
>> From: Mike Fedkiw via Filepro-list
>> [[1][1]mailto:filepro-list at lists.celestial.com]
>> Sent: Friday, August 25, 2017 11:33 AM
>> To: 0 Filepro List [2][2]<filepro-list at lists.celestial.com>
>> Subject: Importing/exporting data with carriage returns (I Think)
>>
>> win-server 2008 r2/filepro 5.0.09dn9
>>
>> Can someone tell me how or what I can do to import data into
>> filepro that has carriage returns within the data cells?
>>
>> I receive these nice XLS files from my vendors with extended
>> descriptions for things that I want to get into a memo fields in
>> filepro but I'm having all sorts of issues trying to make that
>> happen.
>>
>> Usually after setting up the XLS file to the way it needs to be
>> for the import I'd save it as a DXF file. That's been working
>> just fine for quite some time but when a cell contains returns I
>> get an error message saying it's not a valid DXF file. I also
>> tried saving it as a CSV file and importing that but the cells
>> with the returns didn't import at all when I tried that. And I'm
>> not even sure I'm saving it as the correct type of CSV(Comma
>> delimited CSV or MS-DOS CSV) for importing it.
>>
>> Even if I get the import figured out if the data does have and
>> returns within the memo it seems to stop exporting that fields
>> data after the first one.
>>
>> If at all possible, I would really like to maintain the returns
>> because it makes it much easier to read the data in the memo and
>> it would also make the exported data much nicer too read with
>> them included.
>>
>> AND...instead of me sitting here trying to figure this out for
>> another week or so like I just did with all the MEMO stuff, I'd
>> just assume pay someone to set it up for me. If someone is
>> interested in doing that, let me know.
>>
>>
>>
>> Mike
>>
>>
>>
>>
>>
>> _______________________________________________
>> Filepro-list mailing list
>> [[3]3]Filepro-list at lists.celestial.com
>> Subscribe/Unsubscribe/Subscription Changes
>> [4][4]http://mailman.celestial.com/mailman/listinfo/filepro-list
>> _______________________________________________
>> Filepro-list mailing list
>> [[5]5]Filepro-list at lists.celestial.com
>> Subscribe/Unsubscribe/Subscription Changes
>> [6][6]http://mailman.celestial.com/mailman/listinfo/filepro-list
>>
>> _______________________________________________
>> Filepro-list mailing list
>> [[7]7]Filepro-list at lists.celestial.com
>> Subscribe/Unsubscribe/Subscription Changes
>> [8][8]http://mailman.celestial.com/mailman/listinfo/filepro-list
>>
>>
>>
>>
>> ---
>> This email has been checked for viruses by AVG.
>> [9][9]http://www.avg.com
>>
>>
>>
>> _______________________________________________
>> Filepro-list mailing list
>> [[10]10]Filepro-list at lists.celestial.com
>> Subscribe/Unsubscribe/Subscription Changes
>> [11][11]http://mailman.celestial.com/mailman/listinfo/filepro-list
>>
>> References
>>
>> 1. [12]mailto:filepro-list at lists.celestial.com
>> 2. [13]mailto:filepro-list at lists.celestial.com
>> 3. [14]mailto:Filepro-list at lists.celestial.com
>> 4. [15]http://mailman.celestial.com/mailman/listinfo/filepro-list
>> 5. [16]mailto:Filepro-list at lists.celestial.com
>> 6. [17]http://mailman.celestial.com/mailman/listinfo/filepro-list
>> 7. [18]mailto:Filepro-list at lists.celestial.com
>> 8. [19]http://mailman.celestial.com/mailman/listinfo/filepro-list
>> 9. [20]http://www.avg.com/
>> 10. [21]mailto:Filepro-list at lists.celestial.com
>> 11. [22]http://mailman.celestial.com/mailman/listinfo/filepro-list
>>
>> References
>>
>> 1. mailto:filepro-list at lists.celestial.com
>> 2. mailto:filepro-list at lists.celestial.com
>> 3. mailto:3]Filepro-list at lists.celestial.com
>> 4. http://mailman.celestial.com/mailman/listinfo/filepro-list
>> 5. mailto:5]Filepro-list at lists.celestial.com
>> 6. http://mailman.celestial.com/mailman/listinfo/filepro-list
>> 7. mailto:7]Filepro-list at lists.celestial.com
>> 8. http://mailman.celestial.com/mailman/listinfo/filepro-list
>> 9. http://www.avg.com/
>> 10. mailto:10]Filepro-list at lists.celestial.com
>> 11. http://mailman.celestial.com/mailman/listinfo/filepro-list
>> 12. mailto:filepro-list at lists.celestial.com
>> 13. mailto:filepro-list at lists.celestial.com
>> 14. mailto:Filepro-list at lists.celestial.com
>> 15. http://mailman.celestial.com/mailman/listinfo/filepro-list
>> 16. mailto:Filepro-list at lists.celestial.com
>> 17. http://mailman.celestial.com/mailman/listinfo/filepro-list
>> 18. mailto:Filepro-list at lists.celestial.com
>> 19. http://mailman.celestial.com/mailman/listinfo/filepro-list
>> 20. http://www.avg.com/
>> 21. mailto:Filepro-list at lists.celestial.com
>> 22. http://mailman.celestial.com/mailman/listinfo/filepro-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.celestial.com/pipermail/filepro-list/attachments/20170826/a0342bd9/attachment.html>
More information about the Filepro-list
mailing list