Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Automate field type change

Featured Replies

Hello there. I have what is probably a simple question and it seems a scripting question, but perhaps there is a better place to post it - if so, let me know.

I have a large tab separated file with the first row being the field names. There are just under 3000 fields in the data. Each of the fields needs to be set to numeric but when I import the file, all the fields come in "text". Is there a way to automate the change in field type using a script rather than having me go through each field and change the value?

Thanks in advance for your help.

Josh

It seems that you are mixing up records and fields. It's probably better to bring in the 3000 items as 3000 records rather than fields. Then you only have to change one field definition.

  • Author

The data set has about 10,000 records and has 3000 fields.

Edited by Guest

Then you only have to change one field definition.

But he said to have a TAB delimited file, with 3000 names of fields in the first line and numeric DATA into the other lines !

He can open that file with FM, but the converted file will have 3000 text fields...

and asked: how can I change those text fields to number fields (in an automatic manner)?

So the right answer is:

1) convert the file to FM

2) export as XML

3) with WORD (or another text editor)open the exported file and change every occurrence of TYPE="TEXT" to TYPE="NUMBER" and save

4)convert to FM the modified XML file

P.S.: this can be made also on only one record and after import all the 10.000 records !

  • Author

Raybaudi/Daniele  - BINGO! You hit the nail on the head. Thanks very much for your help. That beats the pants of having to do all those by hand.

For Mac users that care, I used an app called BBEdit a freeware version of which is called TextWrangler. BBEdit has been my text based data massaging app for 10 years now and hasn't failed me yet - even on huge text files.

Josh

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.